Skip to content

Commit 1cf2839

Browse files
authored
Updated eslint to v9 (#96)
* chore: Updated dependencies * chore: Updated eslint to v9 * chore: Added lockfile --------- Co-authored-by: ijlee2 <[email protected]>
1 parent 973889d commit 1cf2839

File tree

6 files changed

+668
-418
lines changed

6 files changed

+668
-418
lines changed

.eslintignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 69 deletions
This file was deleted.

.npmignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
/.DS_Store
1010
/.env*
1111
/.eslintcache
12-
/.eslintignore
13-
/.eslintrc.cjs
1412
/.git/
1513
/.github/
1614
/.gitignore
@@ -19,5 +17,6 @@
1917
/.prettierrc.cjs
2018
/build.sh
2119
/CONTRIBUTING.md
22-
/update-test-fixtures.sh
20+
/eslint.config.js
2321
/tests/
22+
/update-test-fixtures.sh

eslint.config.js

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
import babelEslintParser from '@babel/eslint-parser';
2+
import eslint from '@eslint/js';
3+
import eslintPluginImport from 'eslint-plugin-import';
4+
import eslintPluginN from 'eslint-plugin-n';
5+
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';
6+
import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
7+
import eslintPluginTypescriptSortKeys from 'eslint-plugin-typescript-sort-keys';
8+
import globals from 'globals';
9+
// eslint-disable-next-line import/no-unresolved
10+
import tseslint from 'typescript-eslint';
11+
12+
const parserOptionsJs = {
13+
babelOptions: {
14+
plugins: [
15+
[
16+
'@babel/plugin-proposal-decorators',
17+
{
18+
decoratorsBeforeExport: true,
19+
},
20+
],
21+
],
22+
},
23+
ecmaFeatures: {
24+
modules: true,
25+
},
26+
ecmaVersion: 'latest',
27+
requireConfigFile: false,
28+
};
29+
30+
const parserOptionsTs = {
31+
projectService: true,
32+
tsconfigRootDir: import.meta.dirname,
33+
};
34+
35+
export default tseslint.config(
36+
{
37+
ignores: [
38+
'dist/',
39+
'dist-for-testing/',
40+
'node_modules/',
41+
'src/blueprints/',
42+
'tests/fixtures/',
43+
'tmp/',
44+
'!.*',
45+
'.*/',
46+
],
47+
},
48+
49+
{
50+
linterOptions: {
51+
reportUnusedDisableDirectives: 'error',
52+
},
53+
},
54+
{
55+
plugins: {
56+
'simple-import-sort': eslintPluginSimpleImportSort,
57+
},
58+
rules: {
59+
curly: 'error',
60+
'simple-import-sort/imports': 'error',
61+
'simple-import-sort/exports': 'error',
62+
},
63+
},
64+
eslint.configs.recommended,
65+
eslintPluginImport.flatConfigs.recommended,
66+
eslintPluginPrettier,
67+
68+
// JavaScript files
69+
{
70+
files: ['**/*.js'],
71+
languageOptions: {
72+
parser: babelEslintParser,
73+
parserOptions: parserOptionsJs,
74+
},
75+
rules: {
76+
'import/no-duplicates': 'error',
77+
},
78+
},
79+
80+
// TypeScript files
81+
{
82+
extends: [
83+
...tseslint.configs.recommended,
84+
eslintPluginImport.flatConfigs.typescript,
85+
],
86+
files: ['**/*.ts'],
87+
languageOptions: {
88+
parserOptions: parserOptionsTs,
89+
},
90+
plugins: {
91+
'typescript-sort-keys': eslintPluginTypescriptSortKeys,
92+
},
93+
rules: {
94+
'@typescript-eslint/array-type': 'error',
95+
'@typescript-eslint/consistent-type-imports': 'error',
96+
'@typescript-eslint/no-import-type-side-effects': 'error',
97+
'import/no-duplicates': 'error',
98+
'typescript-sort-keys/interface': 'error',
99+
'typescript-sort-keys/string-enum': 'error',
100+
},
101+
settings: {
102+
'import/resolver': {
103+
node: true,
104+
typescript: true,
105+
},
106+
},
107+
},
108+
109+
// Node files
110+
{
111+
files: ['**/*.cjs'],
112+
languageOptions: {
113+
ecmaVersion: 'latest',
114+
globals: {
115+
...globals.node,
116+
},
117+
sourceType: 'script',
118+
},
119+
plugins: {
120+
n: eslintPluginN,
121+
},
122+
},
123+
{
124+
files: ['**/*.mjs'],
125+
languageOptions: {
126+
ecmaVersion: 'latest',
127+
globals: {
128+
...globals.node,
129+
},
130+
parserOptions: parserOptionsJs,
131+
sourceType: 'module',
132+
},
133+
plugins: {
134+
n: eslintPluginN,
135+
},
136+
},
137+
);

package.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,40 @@
3939
"test": "./build.sh --test && mt dist-for-testing --quiet"
4040
},
4141
"dependencies": {
42-
"@codemod-utils/blueprints": "^1.1.6",
43-
"@codemod-utils/files": "^2.0.5",
44-
"@codemod-utils/json": "^1.1.10",
42+
"@codemod-utils/blueprints": "^1.1.8",
43+
"@codemod-utils/files": "^2.0.7",
44+
"@codemod-utils/json": "^1.1.12",
4545
"strip-json-comments": "^5.0.1",
4646
"yargs": "^17.7.2"
4747
},
4848
"devDependencies": {
49-
"@babel/core": "^7.26.0",
50-
"@codemod-utils/tests": "^1.1.8",
49+
"@babel/core": "^7.26.7",
50+
"@babel/eslint-parser": "^7.26.5",
51+
"@babel/plugin-proposal-decorators": "^7.25.9",
52+
"@codemod-utils/tests": "^1.1.10",
53+
"@eslint/js": "^9.19.0",
5154
"@sondr3/minitest": "^0.1.2",
5255
"@tsconfig/node18": "^18.2.4",
5356
"@tsconfig/strictest": "^2.0.5",
54-
"@types/node": "^18.19.70",
57+
"@types/eslint__js": "^8.42.3",
58+
"@types/node": "^18.19.75",
5559
"@types/yargs": "^17.0.33",
56-
"@typescript-eslint/eslint-plugin": "^8.20.0",
57-
"@typescript-eslint/parser": "^8.20.0",
5860
"concurrently": "^9.1.2",
59-
"eslint": "^8.57.1",
61+
"eslint": "^9.19.0",
6062
"eslint-config-prettier": "^10.0.1",
6163
"eslint-import-resolver-typescript": "^3.7.0",
6264
"eslint-plugin-import": "^2.31.0",
6365
"eslint-plugin-n": "^17.15.1",
64-
"eslint-plugin-prettier": "^5.2.2",
66+
"eslint-plugin-prettier": "^5.2.3",
6567
"eslint-plugin-simple-import-sort": "^12.1.1",
6668
"eslint-plugin-typescript-sort-keys": "^3.3.0",
69+
"globals": "^15.14.0",
6770
"lerna-changelog": "^2.2.0",
6871
"prettier": "^3.4.2",
69-
"typescript": "^5.7.3"
72+
"typescript": "^5.7.3",
73+
"typescript-eslint": "^8.23.0"
7074
},
71-
"packageManager": "[email protected].3",
75+
"packageManager": "[email protected].5",
7276
"engines": {
7377
"node": "18.* || >= 20"
7478
},

0 commit comments

Comments
 (0)