Skip to content

Commit 1a6abee

Browse files
committed
chore: switch flat eslint config
1 parent 59cf4dc commit 1a6abee

File tree

12 files changed

+1232
-1139
lines changed

12 files changed

+1232
-1139
lines changed

.eslintignore

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

.eslintrc.cjs

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

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.useFlatConfig": true
3+
}

eslint.config.mjs

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import pluginUnicorn from 'eslint-plugin-unicorn';
2+
import pluginImport from 'eslint-plugin-import';
3+
import pluginNode from 'eslint-plugin-n';
4+
import pluginPromise from 'eslint-plugin-promise';
5+
import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
6+
import { parser, plugin as pluginTs } from 'typescript-eslint';
7+
import configLove from 'eslint-config-love';
8+
import globals from 'globals';
9+
10+
export default [
11+
pluginPrettierRecommended,
12+
{
13+
files: ['**/*.ts', '**/*.js'],
14+
languageOptions: {
15+
parser,
16+
parserOptions: {
17+
project: ['tsconfig.json', 'tsconfig.eslint.json']
18+
},
19+
globals: {
20+
...globals.browser,
21+
...globals.node,
22+
...globals.mocha
23+
}
24+
},
25+
plugins: {
26+
unicorn: pluginUnicorn,
27+
n: pluginNode,
28+
'@typescript-eslint': pluginTs,
29+
promise: pluginPromise,
30+
import: pluginImport
31+
},
32+
rules: {
33+
...configLove.rules,
34+
...pluginImport.flatConfigs.recommended.rules,
35+
'n/no-sync': 'error',
36+
'n/prefer-promises/fs': 'error',
37+
'prettier/prettier': [
38+
'error',
39+
{
40+
endOfLine: 'auto'
41+
}
42+
],
43+
'@typescript-eslint/prefer-nullish-coalescing': [
44+
'error',
45+
{
46+
ignoreConditionalTests: true,
47+
ignoreMixedLogicalExpressions: true
48+
}
49+
],
50+
'@typescript-eslint/strict-boolean-expressions': [
51+
'error',
52+
{
53+
allowString: true,
54+
allowNumber: true,
55+
allowNullableObject: false,
56+
allowNullableBoolean: true,
57+
allowNullableString: true,
58+
allowNullableNumber: true,
59+
allowAny: true
60+
}
61+
],
62+
'@typescript-eslint/restrict-template-expressions': 'off',
63+
'@typescript-eslint/no-unsafe-argument': 'off',
64+
'@typescript-eslint/no-explicit-any': 'off',
65+
'@typescript-eslint/unbound-method': 'off',
66+
'@typescript-eslint/class-methods-use-this': 'off',
67+
'@typescript-eslint/no-magic-numbers': 'off',
68+
'@typescript-eslint/init-declarations': 'off',
69+
'unicorn/prefer-node-protocol': 'error',
70+
'unicorn/catch-error-name': [
71+
'error',
72+
{
73+
name: 'err'
74+
}
75+
]
76+
},
77+
settings: {
78+
'import/parsers': {
79+
'@typescript-eslint/parser': ['.ts', '.tsx']
80+
},
81+
'import/resolver': {
82+
typescript: {
83+
alwaysTryTypes: true
84+
}
85+
}
86+
}
87+
},
88+
{
89+
ignores: ['node_modules/**', 'dist/**', 'out/**']
90+
}
91+
];

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"pretest": "nr build",
1515
"test": "node ./out/test/runTest.js",
1616
"format": "prettier --write .",
17-
"lint": "eslint --ext .ts,.js --fix src test scripts",
17+
"lint": "eslint --fix src test scripts",
1818
"prepublishOnly": "nr build && vsce publish --no-dependencies"
1919
},
2020
"keywords": [
@@ -621,7 +621,7 @@
621621
}
622622
},
623623
"devDependencies": {
624-
"@antfu/ni": "^0.21.12",
624+
"@antfu/ni": "^0.23.0",
625625
"@kokororin/prettierrc": "^0.1.1",
626626
"@types/adm-zip": "^0.5.5",
627627
"@types/debug": "^4.1.12",
@@ -630,32 +630,32 @@
630630
"@types/node": "^18.0.0",
631631
"@types/semver": "^7.5.8",
632632
"@types/vscode": "^1.60.0",
633-
"@typescript-eslint/eslint-plugin": "^7.1.1",
634-
"@typescript-eslint/parser": "^7.1.1",
635633
"@vscode/test-electron": "^2.3.9",
636634
"@vscode/vsce": "^2.31.1",
637635
"adm-zip": "^0.5.10",
638636
"consola": "^3.2.3",
639637
"eslint": "^8.57.0",
638+
"eslint-config-love": "^71.0.0",
640639
"eslint-config-prettier": "^9.1.0",
641-
"eslint-config-standard-with-typescript": "^43.0.1",
642-
"eslint-import-resolver-typescript": "^3.6.1",
643-
"eslint-plugin-import": "^2.29.1",
644-
"eslint-plugin-n": "^16.6.2",
645-
"eslint-plugin-prettier": "^5.1.3",
646-
"eslint-plugin-promise": "^6.1.1",
647-
"eslint-plugin-unicorn": "^53.0.0",
640+
"eslint-import-resolver-typescript": "^3.6.3",
641+
"eslint-plugin-import": "^2.30.0",
642+
"eslint-plugin-n": "^17.10.3",
643+
"eslint-plugin-prettier": "^5.2.1",
644+
"eslint-plugin-promise": "^7.1.0",
645+
"eslint-plugin-unicorn": "^55.0.0",
648646
"fast-glob": "^3.3.2",
647+
"globals": "^15.9.0",
649648
"md5": "^2.3.0",
650649
"mocha": "^10.3.0",
651-
"prettier": "^3.2.5",
650+
"prettier": "^3.3.3",
652651
"read-pkg-up": "^7.0.1",
653652
"rimraf": "^5.0.5",
654653
"semver": "^7.6.0",
655654
"simple-git": "^3.22.0",
656-
"tsup": "^8.0.2",
657-
"tsx": "^4.7.1",
658-
"typescript": "~5.3.0"
655+
"tsup": "^8.3.0",
656+
"tsx": "^4.19.1",
657+
"typescript": "~5.5.0",
658+
"typescript-eslint": "^8.6.0"
659659
},
660660
"dependencies": {
661661
"compare-versions": "^6.1.0",
@@ -664,10 +664,10 @@
664664
"mem": "^8.1.1",
665665
"phpfmt": "^0.0.7"
666666
},
667-
"packageManager": "pnpm@9.2.0",
667+
"packageManager": "pnpm@9.10.0",
668668
"pnpm": {
669669
"patchedDependencies": {
670-
"phpfmt@0.0.7": "patches/phpfmt@0.0.7.patch"
670+
"phpfmt": "patches/phpfmt.patch"
671671
}
672672
}
673673
}
File renamed without changes.

0 commit comments

Comments
 (0)