@lusc/eslint-config 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/typescript.js +47 -42
- package/index.d.ts +6 -0
- package/index.js +28 -22
- package/package.json +11 -9
package/configs/typescript.js
CHANGED
|
@@ -1,46 +1,51 @@
|
|
|
1
1
|
import tsEslint from 'typescript-eslint';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'error',
|
|
15
|
-
{
|
|
16
|
-
allowNumber: true,
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
'@typescript-eslint/unbound-method': 'off',
|
|
20
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
21
|
-
'@typescript-eslint/no-unused-vars': [
|
|
22
|
-
'error',
|
|
23
|
-
{
|
|
24
|
-
vars: 'all',
|
|
25
|
-
varsIgnorePattern: /^_/.source,
|
|
26
|
-
args: 'after-used',
|
|
27
|
-
ignoreRestSiblings: true,
|
|
28
|
-
argsIgnorePattern: /^_/.source,
|
|
29
|
-
caughtErrors: 'all',
|
|
30
|
-
caughtErrorsIgnorePattern: /^_$/.source,
|
|
3
|
+
/**
|
|
4
|
+
* @param {readonly string[]} globs
|
|
5
|
+
*/
|
|
6
|
+
export default function typescript(globs) {
|
|
7
|
+
return [
|
|
8
|
+
...tsEslint.configs.strictTypeChecked,
|
|
9
|
+
{
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parserOptions: {
|
|
12
|
+
projectService: true,
|
|
13
|
+
tsconfigRootDir: import.meta.dirname,
|
|
31
14
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
'@typescript-eslint/restrict-template-expressions': [
|
|
18
|
+
'error',
|
|
19
|
+
{
|
|
20
|
+
allowNumber: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
24
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
25
|
+
'@typescript-eslint/no-unused-vars': [
|
|
26
|
+
'error',
|
|
27
|
+
{
|
|
28
|
+
vars: 'all',
|
|
29
|
+
varsIgnorePattern: /^_/.source,
|
|
30
|
+
args: 'after-used',
|
|
31
|
+
ignoreRestSiblings: true,
|
|
32
|
+
argsIgnorePattern: /^_/.source,
|
|
33
|
+
caughtErrors: 'all',
|
|
34
|
+
caughtErrorsIgnorePattern: /^_$/.source,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'@typescript-eslint/no-misused-promises': [
|
|
38
|
+
'error',
|
|
39
|
+
{
|
|
40
|
+
checksConditionals: true,
|
|
41
|
+
// Useful for event handlers
|
|
42
|
+
checksVoidReturn: false,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
41
46
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
+
].map(config => ({
|
|
48
|
+
...config,
|
|
49
|
+
files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts', ...globs],
|
|
50
|
+
}));
|
|
51
|
+
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -12,27 +12,33 @@ import unicorn from './configs/unicorn.js';
|
|
|
12
12
|
|
|
13
13
|
const ignores = ['**/dist/', '**/.svelte-kit/', '**/build/'];
|
|
14
14
|
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
export function withOptions({typescriptGlobs}) {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
ignores,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
languageOptions: {
|
|
22
|
+
globals: {
|
|
23
|
+
...globals.browser,
|
|
24
|
+
...globals.nodeBuiltin,
|
|
25
|
+
},
|
|
26
|
+
parser: tsParser,
|
|
27
|
+
ecmaVersion: 'latest',
|
|
28
|
+
sourceType: 'module',
|
|
24
29
|
},
|
|
25
|
-
parser: tsParser,
|
|
26
|
-
ecmaVersion: 'latest',
|
|
27
|
-
sourceType: 'module',
|
|
28
30
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
eslint,
|
|
32
|
+
comments,
|
|
33
|
+
promise,
|
|
34
|
+
unicorn,
|
|
35
|
+
n,
|
|
36
|
+
importConfig,
|
|
37
|
+
regexp,
|
|
38
|
+
typescript(typescriptGlobs),
|
|
39
|
+
].flat();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default withOptions({
|
|
43
|
+
typescriptGlobs: [],
|
|
44
|
+
});
|
package/package.json
CHANGED
|
@@ -5,21 +5,23 @@
|
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
8
|
-
"@eslint/js": "^9.
|
|
9
|
-
"@typescript-eslint/parser": "^8.
|
|
8
|
+
"@eslint/js": "^9.15.0",
|
|
9
|
+
"@typescript-eslint/parser": "^8.15.0",
|
|
10
10
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
11
11
|
"eslint-plugin-import-x": "^4.4.2",
|
|
12
|
-
"eslint-plugin-n": "^17.13.
|
|
12
|
+
"eslint-plugin-n": "^17.13.2",
|
|
13
13
|
"eslint-plugin-promise": "^7.1.0",
|
|
14
|
-
"eslint-plugin-regexp": "^2.
|
|
15
|
-
"eslint-plugin-unicorn": "^56.0.
|
|
14
|
+
"eslint-plugin-regexp": "^2.7.0",
|
|
15
|
+
"eslint-plugin-unicorn": "^56.0.1",
|
|
16
16
|
"globals": "^15.12.0",
|
|
17
17
|
"typescript": "^5.6.3",
|
|
18
|
-
"typescript-eslint": "^8.
|
|
18
|
+
"typescript-eslint": "^8.15.0"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"eslint": "^9"
|
|
19
22
|
},
|
|
20
23
|
"devDependencies": {
|
|
21
|
-
"
|
|
22
|
-
"eslint": "^9.14.0",
|
|
24
|
+
"eslint": "^9.15.0",
|
|
23
25
|
"prettier": "^3.3.3"
|
|
24
26
|
},
|
|
25
27
|
"exports": {
|
|
@@ -43,6 +45,6 @@
|
|
|
43
45
|
"fmt": "prettier -w .",
|
|
44
46
|
"lint": "eslint --fix"
|
|
45
47
|
},
|
|
46
|
-
"version": "3.
|
|
48
|
+
"version": "3.2.0",
|
|
47
49
|
"type": "module"
|
|
48
50
|
}
|