Skip to content

Commit

Permalink
Merge pull request #145 from wellcomecollection/eslint-ignore
Browse files Browse the repository at this point in the history
Add "ignorePattern" to eslint and add .vscode settings
  • Loading branch information
rcantin-w authored Oct 3, 2024
2 parents 3ed14f4 + deee485 commit 42bf46c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,22 @@ const sharedRules = {
],
};

const ignorePatterns = [
'/**/node_modules/',
'/**/libs/',
'/**/lib/',
'/**/_next/',
'/**/dist/',
];

module.exports = {
parser: '@babel/eslint-parser',
plugins: sharedPlugins,
env: {
'jest/globals': true,
},
extends: sharedExtends,
ignorePatterns,
rules: sharedRules,
reportUnusedDisableDirectives: true,
parserOptions: {
Expand All @@ -71,11 +80,11 @@ module.exports = {
{
// we have non-test files in the pipeline/test directory
// this ensures the jest rules only apply to test files
files: ['*test.ts', '*test.tsx'],
files: ['*test.ts'],
extends: ['plugin:jest/recommended'],
},
{
files: ['*.ts', '*.tsx'],
files: ['*.ts'],
parser: '@typescript-eslint/parser',
plugins: [...sharedPlugins, '@typescript-eslint'],
extends: [...sharedExtends, 'plugin:@typescript-eslint/recommended'],
Expand Down
11 changes: 10 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"editor.formatOnSave": true
// We add this to avoid having linting commits in CI
"editor.tabSize": 2,
"files.encoding": "utf8",
"editor.codeActionsOnSave": {
"editor.insertSpaces": "explicit",
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit",
"files.trimTrailingWhitespace": "explicit"
},
"stylelint.validate": ["typescriptreact"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"prepare": "husky install",
"lint": "eslint \"**/*.{js,ts,tsx}\""
"lint": "eslint \"**/*.{js,ts}\""
},
"devDependencies": {
"@babel/eslint-parser": "^7.22.9",
Expand Down

0 comments on commit 42bf46c

Please sign in to comment.