Skip to content

Commit 9797781

Browse files
Copilotrubensworks
andauthored
Migrate ESLint to flat config: package.json, eslint.config.js, remove .eslintrc.js
Agent-Logs-Url: https://github.com/LinkedSoftwareDependencies/Components.js/sessions/41072e3c-07ef-4099-af17-e1f8b941bc2a Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
1 parent ce17005 commit 9797781

4 files changed

Lines changed: 1322 additions & 669 deletions

File tree

.eslintrc.js

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

eslint.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const config = require('@rubensworks/eslint-config');
2+
3+
module.exports = config([
4+
{
5+
ignores: [
6+
'node_modules',
7+
'coverage',
8+
'**/*.js',
9+
'**/*.d.ts',
10+
'**/*.js.map',
11+
'**/*.md',
12+
'**/*.yml',
13+
'**/*.yaml',
14+
'**/*.json',
15+
],
16+
},
17+
{
18+
files: [ '**/*.ts' ],
19+
languageOptions: {
20+
parserOptions: {
21+
tsconfigRootDir: __dirname,
22+
project: [ './tsconfig.eslint.json' ],
23+
},
24+
},
25+
},
26+
{
27+
rules: {
28+
'no-implicit-coercion': 'off',
29+
'no-sync': 'off',
30+
},
31+
},
32+
{
33+
// Specific rules for test files
34+
files: [ '**/test/**/*.ts' ],
35+
rules: {
36+
'ts/require-array-sort-compare': 'off',
37+
},
38+
},
39+
]);

package.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test-watch": "jest --watch",
3030
"build": "scopy ./components/context.jsonld ./components/context.json && tsc && chmod +x ./bin/compile-config.js",
3131
"build-watch": "tsc --watch",
32-
"lint": "eslint . --ext .ts --cache",
32+
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint . --cache",
3333
"validate": "yarn info",
3434
"prepare": "yarn build",
3535
"version": "manual-git-changelog onversion"
@@ -51,19 +51,11 @@
5151
"winston": "^3.3.3"
5252
},
5353
"devDependencies": {
54-
"@rubensworks/eslint-config": "1.2.0",
54+
"@rubensworks/eslint-config": "3.1.0",
5555
"@types/jest": "^30.0.0",
5656
"@types/stream-to-array": "^2.3.0",
5757
"@types/streamify-string": "^1.0.0",
58-
"@typescript-eslint/eslint-plugin": "^5.0.0",
59-
"@typescript-eslint/parser": "^5.0.0",
60-
"eslint": "^7.12.1",
61-
"eslint-config-es": "3.25.3",
62-
"eslint-import-resolver-typescript": "^2.3.0",
63-
"eslint-plugin-import": "^2.22.1",
64-
"eslint-plugin-jest": "^26.0.0",
65-
"eslint-plugin-tsdoc": "^0.2.7",
66-
"eslint-plugin-unused-imports": "^2.0.0",
58+
"eslint": "^8.57.0",
6759
"jest": "^30.0.0",
6860
"jest-mock": "^30.0.0",
6961
"jest-rdf": "^2.0.0",

0 commit comments

Comments
 (0)