Skip to content

Commit 538afa9

Browse files
authored
build: 📦 migrate to eslint flat (#10)
1 parent 7e3abe8 commit 538afa9

9 files changed

+56
-68
lines changed

‎.eslintignore

-1
This file was deleted.

‎.eslintrc.json

-41
This file was deleted.

‎apps/cookbook/.eslintignore

-1
This file was deleted.

‎apps/cookbook/.eslintrc.json

-18
This file was deleted.

‎apps/cookbook/eslint.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const nx = require('@nx/eslint-plugin');
2+
const baseConfig = require('../../eslint.config.js');
3+
4+
module.exports = [
5+
...baseConfig,
6+
...nx.configs['flat/react'],
7+
{
8+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
9+
// Override or add rules here
10+
rules: {},
11+
},
12+
];

‎bun.lockb

9.25 KB
Binary file not shown.

‎eslint.config.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const nx = require('@nx/eslint-plugin');
2+
3+
module.exports = [
4+
...nx.configs['flat/base'],
5+
...nx.configs['flat/typescript'],
6+
...nx.configs['flat/javascript'],
7+
{
8+
ignores: ['**/dist'],
9+
},
10+
{
11+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
12+
rules: {
13+
'@nx/enforce-module-boundaries': [
14+
'error',
15+
{
16+
enforceBuildableLibDependency: true,
17+
allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?js$'],
18+
depConstraints: [
19+
{
20+
sourceTag: '*',
21+
onlyDependOnLibsWithTags: ['*'],
22+
},
23+
],
24+
},
25+
],
26+
},
27+
},
28+
{
29+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
30+
// Override or add rules here
31+
rules: {},
32+
},
33+
];

‎nx.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"production": [
1919
"default",
2020
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
21-
"!{projectRoot}/tsconfig.spec.json"
21+
"!{projectRoot}/tsconfig.spec.json",
22+
"!{projectRoot}/eslint.config.js"
2223
]
2324
},
2425
"defaultBase": "main",

‎package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"@docusaurus/module-type-aliases": "3.6.3",
1919
"@docusaurus/tsconfig": "3.6.3",
2020
"@docusaurus/types": "3.6.3",
21+
"@eslint/eslintrc": "3.2.0",
22+
"@eslint/js": "9.16.0",
2123
"@nx/eslint": "19.8.9",
2224
"@nx/eslint-plugin": "19.8.9",
2325
"@nx/react": "19.8.9",
@@ -26,21 +28,22 @@
2628
"@nx/workspace": "19.8.9",
2729
"@testing-library/jest-dom": "6.4.2",
2830
"@testing-library/react": "15.0.6",
29-
"@typescript-eslint/eslint-plugin": "7.18.0",
30-
"@typescript-eslint/parser": "7.18.0",
31+
"@typescript-eslint/eslint-plugin": "8.17.0",
32+
"@typescript-eslint/parser": "8.17.0",
3133
"@vitest/ui": "1.4.0",
32-
"eslint": "8.57.0",
34+
"eslint": "9.16.0",
3335
"eslint-config-prettier": "9.1.0",
3436
"eslint-plugin-import": "2.31.0",
35-
"eslint-plugin-jsx-a11y": "6.10.1",
36-
"eslint-plugin-react": "7.34.1",
37-
"eslint-plugin-react-hooks": "5.0.0",
37+
"eslint-plugin-jsx-a11y": "6.10.2",
38+
"eslint-plugin-react": "7.37.2",
39+
"eslint-plugin-react-hooks": "5.1.0",
3840
"firebase-tools": "13.10.2",
3941
"jsdom": "24.0.0",
4042
"nx": "19.8.9",
4143
"nx-cloud": "19.1.0",
4244
"prettier": "3.2.5",
4345
"typescript": "5.5.4",
46+
"typescript-eslint": "8.17.0",
4447
"vite": "5.2.8",
4548
"vitest": "1.4.0"
4649
},

0 commit comments

Comments
 (0)