@cto.af/eslint-config 6.0.17 → 6.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/all.js +13 -12
- package/allModule.js +5 -4
- package/ava.js +3 -2
- package/cjs.js +4 -2
- package/es6.js +5 -4
- package/ignores.js +8 -8
- package/index.js +7 -6
- package/js.js +4 -3
- package/jsdoc.js +3 -2
- package/jsdoc_ts.js +18 -4
- package/json.js +4 -3
- package/markdown.js +4 -3
- package/mjs.js +4 -2
- package/mocha.js +3 -2
- package/module.js +4 -2
- package/package.json +4 -4
- package/rules/ava.js +2 -0
- package/rules/js.js +2 -0
- package/rules/jsdoc.js +2 -0
- package/rules/json.js +2 -0
- package/rules/markdown.js +2 -0
- package/rules/ts.js +4 -0
- package/ts.js +7 -4
package/all.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ava from './ava.js';
|
|
2
2
|
import cjs from './cjs.js';
|
|
3
|
+
import {defineConfig} from 'eslint/config';
|
|
3
4
|
import ignores from './ignores.js';
|
|
4
5
|
import js from './js.js';
|
|
5
6
|
import jsdoc from './jsdoc.js';
|
|
@@ -10,15 +11,15 @@ import mjs from './mjs.js';
|
|
|
10
11
|
import ts from './ts.js';
|
|
11
12
|
|
|
12
13
|
// Turn on everything. Requires all of the optional dependencies.
|
|
13
|
-
export default
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
export default defineConfig(
|
|
15
|
+
ignores,
|
|
16
|
+
js,
|
|
17
|
+
mjs,
|
|
18
|
+
cjs,
|
|
19
|
+
ts,
|
|
20
|
+
jsdoc,
|
|
21
|
+
jsdoc_ts,
|
|
22
|
+
json,
|
|
23
|
+
ava,
|
|
24
|
+
markdown
|
|
25
|
+
);
|
package/allModule.js
CHANGED
package/ava.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import ava from 'eslint-plugin-ava';
|
|
2
|
+
import {defineConfig} from 'eslint/config';
|
|
2
3
|
import n from 'eslint-plugin-n';
|
|
3
4
|
import {rules} from './rules/ava.js';
|
|
4
5
|
|
|
5
|
-
export default
|
|
6
|
+
export default defineConfig({
|
|
6
7
|
files: [
|
|
7
8
|
'**/test/**.test.*',
|
|
8
9
|
'**/test/**.ava.*',
|
|
@@ -16,4 +17,4 @@ export default [{
|
|
|
16
17
|
n,
|
|
17
18
|
},
|
|
18
19
|
rules,
|
|
19
|
-
}
|
|
20
|
+
});
|
package/cjs.js
CHANGED
package/es6.js
CHANGED
package/ignores.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import {globalIgnores} from 'eslint/config';
|
|
2
|
+
|
|
3
|
+
export default globalIgnores([
|
|
4
|
+
'**/*.d.ts',
|
|
5
|
+
'**/coverage/**',
|
|
6
|
+
'**/node_modules/**',
|
|
7
|
+
'**/docs/**',
|
|
8
|
+
]);
|
package/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import {defineConfig} from 'eslint/config';
|
|
1
2
|
import ignores from './ignores.js';
|
|
2
3
|
import js from './js.js';
|
|
3
4
|
import json from './json.js';
|
|
4
5
|
import mjs from './mjs.js';
|
|
5
6
|
|
|
6
7
|
// Just the core rules, no optional dependencies needed.
|
|
7
|
-
export default
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export default defineConfig(
|
|
9
|
+
ignores,
|
|
10
|
+
js,
|
|
11
|
+
mjs,
|
|
12
|
+
json
|
|
13
|
+
);
|
package/js.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import {defineConfig} from 'eslint/config';
|
|
1
2
|
import globals from 'globals';
|
|
2
3
|
import n from 'eslint-plugin-n';
|
|
3
4
|
import redos from 'eslint-plugin-redos';
|
|
4
5
|
import {rules} from './rules/js.js';
|
|
5
6
|
import stylistic from '@stylistic/eslint-plugin';
|
|
6
7
|
|
|
7
|
-
export default
|
|
8
|
+
export default defineConfig(
|
|
8
9
|
{
|
|
9
10
|
files: [
|
|
10
11
|
'**/*.js',
|
|
@@ -37,5 +38,5 @@ export default [
|
|
|
37
38
|
'no-console': 'off',
|
|
38
39
|
'n/no-top-level-await': 'off',
|
|
39
40
|
},
|
|
40
|
-
}
|
|
41
|
-
|
|
41
|
+
}
|
|
42
|
+
);
|
package/jsdoc.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {defineConfig} from 'eslint/config';
|
|
1
2
|
import jsdoc from 'eslint-plugin-jsdoc';
|
|
2
3
|
import {rules} from './rules/jsdoc.js';
|
|
3
4
|
|
|
4
|
-
export default
|
|
5
|
+
export default defineConfig({
|
|
5
6
|
files: [
|
|
6
7
|
'**/*.js',
|
|
7
8
|
'**/*.cjs',
|
|
@@ -19,4 +20,4 @@ export default [{
|
|
|
19
20
|
},
|
|
20
21
|
},
|
|
21
22
|
rules,
|
|
22
|
-
}
|
|
23
|
+
});
|
package/jsdoc_ts.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import {defineConfig} from 'eslint/config';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
2
4
|
files: [
|
|
3
5
|
'**/*.ts',
|
|
4
6
|
],
|
|
5
7
|
rules: {
|
|
8
|
+
'jsdoc/no-types': 'error', // Type info comes from TS
|
|
6
9
|
'jsdoc/no-undefined-types': 'off', // Switch to typedoc
|
|
7
|
-
'jsdoc/require-
|
|
8
|
-
'jsdoc/require-
|
|
10
|
+
'jsdoc/require-next-type': 'off',
|
|
11
|
+
'jsdoc/require-param-type': 'off',
|
|
12
|
+
'jsdoc/require-property-type': 'off',
|
|
13
|
+
'jsdoc/require-returns-type': 'off',
|
|
14
|
+
'jsdoc/require-returns': ['error', {
|
|
15
|
+
checkConstructors: false,
|
|
16
|
+
checkGetters: false,
|
|
17
|
+
forceRequireReturn: false,
|
|
18
|
+
forceReturnsWithAsync: false,
|
|
19
|
+
publicOnly: true,
|
|
20
|
+
}],
|
|
21
|
+
'jsdoc/require-throws-type': 'off',
|
|
22
|
+
'jsdoc/require-yields-type': 'off',
|
|
9
23
|
},
|
|
10
|
-
}
|
|
24
|
+
});
|
package/json.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {defineConfig} from 'eslint/config';
|
|
1
2
|
import json from '@eslint/json';
|
|
2
3
|
import {rules} from './rules/json.js';
|
|
3
4
|
|
|
4
|
-
export default
|
|
5
|
+
export default defineConfig(
|
|
5
6
|
{
|
|
6
7
|
plugins: {
|
|
7
8
|
json,
|
|
@@ -24,5 +25,5 @@ export default [
|
|
|
24
25
|
files: ['**/*.json5'],
|
|
25
26
|
language: 'json/json5',
|
|
26
27
|
rules,
|
|
27
|
-
}
|
|
28
|
-
|
|
28
|
+
}
|
|
29
|
+
);
|
package/markdown.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {defineConfig} from 'eslint/config';
|
|
1
2
|
import markdown from '@eslint/markdown';
|
|
2
3
|
import {rules} from './rules/markdown.js';
|
|
3
4
|
|
|
4
|
-
export default
|
|
5
|
+
export default defineConfig(
|
|
5
6
|
{
|
|
6
7
|
files: [
|
|
7
8
|
'**/*.md',
|
|
@@ -33,5 +34,5 @@ export default [
|
|
|
33
34
|
'n/no-missing-import': 'off',
|
|
34
35
|
'n/no-top-level-await': 'off',
|
|
35
36
|
},
|
|
36
|
-
}
|
|
37
|
-
|
|
37
|
+
}
|
|
38
|
+
);
|
package/mjs.js
CHANGED
package/mocha.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {defineConfig} from 'eslint/config';
|
|
1
2
|
import globals from 'globals';
|
|
2
3
|
import mocha from 'eslint-plugin-mocha';
|
|
3
4
|
|
|
4
|
-
export default
|
|
5
|
+
export default defineConfig({
|
|
5
6
|
files: [
|
|
6
7
|
'test/**/*.spec.js',
|
|
7
8
|
'test/**/*.spec.ts',
|
|
@@ -31,4 +32,4 @@ export default [{
|
|
|
31
32
|
...mocha.configs.recommended.rules,
|
|
32
33
|
'mocha/no-mocha-arrows': 'off',
|
|
33
34
|
},
|
|
34
|
-
}
|
|
35
|
+
});
|
package/module.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cto.af/eslint-config",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "hildjj's lint rules",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"url": "git+https://github.com/cto-af/eslint-config.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@eslint/json": "0.
|
|
17
|
+
"@eslint/json": "0.14.0",
|
|
18
18
|
"@stylistic/eslint-plugin": "5.5.0",
|
|
19
19
|
"eslint-plugin-n": "17.23.1",
|
|
20
20
|
"eslint-plugin-redos": "4.4.5",
|
|
21
|
-
"globals": "16.
|
|
21
|
+
"globals": "16.5.0"
|
|
22
22
|
},
|
|
23
|
-
"packageManager": "pnpm@10.
|
|
23
|
+
"packageManager": "pnpm@10.22.0",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=20"
|
|
26
26
|
}
|
package/rules/ava.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* eslint meta/no-unused-rules: ["error", {ignore: ["n"]}] */
|
|
2
2
|
|
|
3
|
+
/** @import {RulesConfig} from '@eslint/core' */
|
|
4
|
+
/** @type {Partial<RulesConfig>}*/
|
|
3
5
|
export const rules = {
|
|
4
6
|
// [ava](https://github.com/avajs/eslint-plugin-ava?tab=readme-ov-file#rules)
|
|
5
7
|
'ava/assertion-arguments': 'error',
|
package/rules/js.js
CHANGED
package/rules/jsdoc.js
CHANGED
package/rules/json.js
CHANGED
package/rules/markdown.js
CHANGED
package/rules/ts.js
CHANGED
|
@@ -3,13 +3,17 @@ import ts from 'typescript-eslint';
|
|
|
3
3
|
|
|
4
4
|
const originalDisabled = {};
|
|
5
5
|
builtinRules.forEach((_, r) => {
|
|
6
|
+
// @ts-expect-error TODO(hildjj): fix types
|
|
6
7
|
if (ts.plugin.rules[r]) {
|
|
8
|
+
// @ts-expect-error TODO(hildjj): fix types
|
|
7
9
|
originalDisabled[r] = 'off';
|
|
8
10
|
}
|
|
9
11
|
});
|
|
10
12
|
|
|
11
13
|
/* eslint meta/no-unused-rules: ["error", {ignore: ["@stylistic"]}] */
|
|
12
14
|
|
|
15
|
+
/** @import {RulesConfig} from '@eslint/core' */
|
|
16
|
+
/** @type {Partial<RulesConfig>}*/
|
|
13
17
|
export const rules = {
|
|
14
18
|
// [original disabled for extension](https://typescript-eslint.io/rules/?=extension#extension-rules)
|
|
15
19
|
...originalDisabled,
|
package/ts.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {defineConfig} from 'eslint/config';
|
|
1
2
|
import ignores from './ignores.js';
|
|
2
3
|
import {rules} from './rules/ts.js';
|
|
3
4
|
import tslint from 'typescript-eslint';
|
|
4
5
|
|
|
5
6
|
const blob = {
|
|
6
7
|
files: ['**/*.ts'],
|
|
7
|
-
ignores: ignores[0].ignores,
|
|
8
8
|
settings: {
|
|
9
9
|
n: {
|
|
10
10
|
// Ensure that importing real .js files works
|
|
@@ -22,8 +22,10 @@ const blob = {
|
|
|
22
22
|
rules,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
// @ts-expect-error TODO(hildjj): fix types
|
|
25
26
|
blob.languageOptions.parserOptions = {
|
|
26
27
|
// It's undefined for now, but just in case.
|
|
28
|
+
// @ts-expect-error TODO(hildjj): fix types
|
|
27
29
|
...blob.languageOptions.parserOptions,
|
|
28
30
|
project: true,
|
|
29
31
|
};
|
|
@@ -45,7 +47,8 @@ testBlob.settings = {
|
|
|
45
47
|
},
|
|
46
48
|
};
|
|
47
49
|
|
|
48
|
-
export default
|
|
50
|
+
export default defineConfig(
|
|
51
|
+
ignores,
|
|
49
52
|
blob,
|
|
50
|
-
testBlob
|
|
51
|
-
|
|
53
|
+
testBlob
|
|
54
|
+
);
|