Skip to content

Commit 9331f3a

Browse files
authored
fix(eslint): update linting ignore patterns (#754)
ESLint was finding built files, when they existed, and not ignoring them. This issue was two-fold: 1. The patterns weren't right per ESLint's new expectation for relative and recursive patterns, so the files would be considered if present 2. The ignores were only configured in our main config, such that other plugins and so on would not use the list of ignores Updating the patterns and putting them in their own object at the start of the final config returns us to a fast, passing lint even in the presence of built files.
1 parent e13824d commit 9331f3a

File tree

6 files changed

+306
-57
lines changed

6 files changed

+306
-57
lines changed

.yarn/install-state.gz

20.9 KB
Binary file not shown.

eslint.config.mjs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ import storybookPlugin from 'eslint-plugin-storybook';
66
import typeScriptEsLint from '@typescript-eslint/eslint-plugin';
77
import globals from 'globals';
88

9+
const globalIgnores = [
10+
'.storybook-static/',
11+
'packages/pharos/coverage/',
12+
'packages/pharos/lib/',
13+
'packages/pharos/src/styles/**/*.ts',
14+
'packages/pharos-site/public/',
15+
'packages/pharos-site/.cache/',
16+
'**/dist/',
17+
'**/node_modules/',
18+
'**/*.css.ts',
19+
];
20+
921
const pharosConfig = {
10-
ignores: [
11-
'node_modules/',
12-
'dist/',
13-
'lib/',
14-
'.storybook-static/',
15-
'packages/pharos/coverage/**/*.js',
16-
'packages/pharos/src/styles/**/*.ts',
17-
'packages/pharos-site/public/',
18-
'packages/pharos-site/.cache/',
19-
'**/*.css.ts',
20-
],
2122
languageOptions: {
2223
parser: babelParser,
2324
globals: {
@@ -107,4 +108,11 @@ const mdxConfig = {
107108
},
108109
};
109110

110-
export default [js.configs.recommended, pharosConfig, tsConfig, tsxConfig, mdxConfig];
111+
export default [
112+
{ ignores: globalIgnores },
113+
js.configs.recommended,
114+
pharosConfig,
115+
tsConfig,
116+
tsxConfig,
117+
mdxConfig,
118+
];

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@commitlint/cli": "^19.3.0",
6666
"@commitlint/config-conventional": "^19.2.2",
6767
"@emotion/babel-plugin": "^11.11.0",
68-
"@size-limit/preset-small-lib": "^11.1.2",
68+
"@size-limit/preset-small-lib": "^11.1.3",
6969
"@storybook/addon-a11y": "^8.0.10",
7070
"@storybook/addon-essentials": "^8.0.10",
7171
"@storybook/addon-links": "^8.0.10",
@@ -107,7 +107,7 @@
107107
"react": "^18.3.1",
108108
"react-dom": "^18.3.1",
109109
"sass": "^1.77.0",
110-
"size-limit": "^11.1.2",
110+
"size-limit": "^11.1.3",
111111
"storybook": "^8.0.10",
112112
"stylelint": "^16.5.0",
113113
"stylelint-config-standard-scss": "^13.1.0",

packages/pharos-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"devDependencies": {
1818
"@types/jest": "^29.5.12",
19-
"@types/node": "^20.12.10",
19+
"@types/node": "^20.12.11",
2020
"jest": "^29.7.0",
2121
"ts-jest": "^29.1.2",
2222
"ts-morph": "^22.0.0",

packages/pharos/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"react": "^18.3.1",
8484
"react-dom": "^18.3.1",
8585
"replace-in-file": "^7.1.0",
86-
"rimraf": "^5.0.5",
86+
"rimraf": "^5.0.6",
8787
"sassdoc": "^2.7.4",
8888
"sinon": "^17.0.2",
8989
"style-dictionary": "^3.9.2",

0 commit comments

Comments
 (0)