@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 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
- ...ignores,
15
- ...js,
16
- ...mjs,
17
- ...cjs,
18
- ...ts,
19
- ...jsdoc,
20
- ...jsdoc_ts,
21
- ...json,
22
- ...ava,
23
- ...markdown,
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
@@ -1,7 +1,8 @@
1
1
  import all from './all.js';
2
+ import {defineConfig} from 'eslint/config';
2
3
  import mod from './module.js';
3
4
 
4
- export default [
5
- ...all,
6
- ...mod,
7
- ];
5
+ export default defineConfig(
6
+ all,
7
+ mod
8
+ );
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
@@ -1,8 +1,10 @@
1
- export default [{
1
+ import {defineConfig} from 'eslint/config';
2
+
3
+ export default defineConfig({
2
4
  files: [
3
5
  '**/*.cjs',
4
6
  ],
5
7
  languageOptions: {
6
8
  sourceType: 'commonjs',
7
9
  },
8
- }];
10
+ });
package/es6.js CHANGED
@@ -1,8 +1,9 @@
1
+ import {defineConfig} from 'eslint/config';
1
2
  import index from './index.js';
2
3
  import mod from './module.js';
3
4
 
4
5
  // Turn on es6 modules
5
- export default [
6
- ...index,
7
- ...mod,
8
- ];
6
+ export default defineConfig(
7
+ index,
8
+ mod
9
+ );
package/ignores.js CHANGED
@@ -1,8 +1,8 @@
1
- export default [{
2
- ignores: [
3
- '**/*.d.ts',
4
- 'coverage/**',
5
- 'node_modules/**',
6
- 'docs/**',
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
- ...ignores,
9
- ...js,
10
- ...mjs,
11
- ...json,
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
- export default [{
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-param-type': 'off', // Not needed in TS
8
- 'jsdoc/require-returns-type': 'off', // Not needed in TS
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
@@ -1,4 +1,6 @@
1
- export default [{
1
+ import {defineConfig} from 'eslint/config';
2
+
3
+ export default defineConfig({
2
4
  files: [
3
5
  '**/*.mjs',
4
6
  '**/*.ts',
@@ -6,4 +8,4 @@ export default [{
6
8
  languageOptions: {
7
9
  sourceType: 'module',
8
10
  },
9
- }];
11
+ });
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
@@ -1,6 +1,8 @@
1
- export default [{
1
+ import {defineConfig} from 'eslint/config';
2
+
3
+ export default defineConfig({
2
4
  files: ['**/*.js'],
3
5
  languageOptions: {
4
6
  sourceType: 'module',
5
7
  },
6
- }];
8
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cto.af/eslint-config",
3
- "version": "6.0.17",
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.13.2",
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.4.0"
21
+ "globals": "16.5.0"
22
22
  },
23
- "packageManager": "pnpm@10.19.0",
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
@@ -1,3 +1,5 @@
1
+ /** @import {RulesConfig} from '@eslint/core' */
2
+ /** @type {Partial<RulesConfig>}*/
1
3
  export const rules = {
2
4
  // [Possible Problems](https://eslint.org/docs/rules/#possible-problems)
3
5
  'array-callback-return': ['error', {allowImplicit: true}],
package/rules/jsdoc.js CHANGED
@@ -1,3 +1,5 @@
1
+ /** @import {RulesConfig} from '@eslint/core' */
2
+ /** @type {Partial<RulesConfig>}*/
1
3
  export const rules = {
2
4
  // Check: jsdoc
3
5
  // [Stylistic Issues](https://eslint.org/docs/rules/#stylistic-issues)
package/rules/json.js CHANGED
@@ -1,3 +1,5 @@
1
+ /** @import {RulesConfig} from '@eslint/core' */
2
+ /** @type {Partial<RulesConfig>}*/
1
3
  export const rules = {
2
4
  // [Rules](https://github.com/eslint/json?tab=readme-ov-file#rules)
3
5
  'json/no-duplicate-keys': 'error',
package/rules/markdown.js CHANGED
@@ -1,3 +1,5 @@
1
+ /** @import {RulesConfig} from '@eslint/core' */
2
+ /** @type {Partial<RulesConfig>}*/
1
3
  export const rules = {
2
4
  // Check: markdown
3
5
  // [Rules](https://github.com/eslint/markdown?tab=readme-ov-file#rules)
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
+ );