@darksheep/eslint 5.1.4 โ†’ 5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.2.0](https://github.com/DarkSheepSoftware/eslint/compare/v5.1.5...v5.2.0) (2024-08-06)
4
+
5
+
6
+ ### ๐ŸŒŸ Features
7
+
8
+ * remove deprecated rules and add config names ([5765861](https://github.com/DarkSheepSoftware/eslint/commit/57658619314ced4312467ae58bfcc09cee98cf8b))
9
+ * Unbundle eslint ([f0550b5](https://github.com/DarkSheepSoftware/eslint/commit/f0550b5910327b0e9f74e4ee78ca296d279f37b0))
10
+
11
+
12
+ ### ๐Ÿ“ฆ Dependencies
13
+
14
+ * **pkg:** update dependency eslint-plugin-perfectionist to v3.1.2 ([#550](https://github.com/DarkSheepSoftware/eslint/issues/550)) ([c0da407](https://github.com/DarkSheepSoftware/eslint/commit/c0da407889520a13f401411974f397c34360bc46))
15
+ * **pkg:** update typescript-eslint monorepo to v8.0.1 ([#551](https://github.com/DarkSheepSoftware/eslint/issues/551)) ([1dfbc75](https://github.com/DarkSheepSoftware/eslint/commit/1dfbc75f37d53aa4ee0df19ab90d01a0964adb68))
16
+
17
+ ## [5.1.5](https://github.com/DarkSheepSoftware/eslint/compare/v5.1.4...v5.1.5) (2024-08-05)
18
+
19
+
20
+ ### ๐Ÿ“ฆ Dependencies
21
+
22
+ * **deps:** update yarn to v4.4.0 ([#545](https://github.com/DarkSheepSoftware/eslint/issues/545)) ([173e85a](https://github.com/DarkSheepSoftware/eslint/commit/173e85a4f62e3c029593ea646745b6156a542b9d))
23
+ * **dev:** update dependency @types/node to v20.14.14 ([#542](https://github.com/DarkSheepSoftware/eslint/issues/542)) ([9a6354f](https://github.com/DarkSheepSoftware/eslint/commit/9a6354f9c01b8a253d2cb7d91ec8cce40ee00430))
24
+ * **lock:** lock file maintenance ([#546](https://github.com/DarkSheepSoftware/eslint/issues/546)) ([49903fd](https://github.com/DarkSheepSoftware/eslint/commit/49903fd740b28ba487e6858ae811a45004dfcda9))
25
+ * **pkg:** update dependency @stylistic/eslint-plugin to v2.6.1 ([#541](https://github.com/DarkSheepSoftware/eslint/issues/541)) ([ce16506](https://github.com/DarkSheepSoftware/eslint/commit/ce16506afb4ec6114a29ce024146f608d05ed1a0))
26
+ * **pkg:** update dependency eslint-plugin-jsdoc to v48.11.0 ([#543](https://github.com/DarkSheepSoftware/eslint/issues/543)) ([8d4c054](https://github.com/DarkSheepSoftware/eslint/commit/8d4c054c46bbaf6ba470d611b640ffe5944a4c14))
27
+ * **pkg:** update dependency eslint-plugin-n to v17.10.2 ([#548](https://github.com/DarkSheepSoftware/eslint/issues/548)) ([dec7707](https://github.com/DarkSheepSoftware/eslint/commit/dec7707297b228c293aecea1bf6de4eeb3be321b))
28
+ * **pkg:** update dependency eslint-plugin-perfectionist to v3.1.1 ([#544](https://github.com/DarkSheepSoftware/eslint/issues/544)) ([d260b8a](https://github.com/DarkSheepSoftware/eslint/commit/d260b8aad2b45d43d0c7d5c02bd35f840c217a59))
29
+
30
+
31
+ ### ๐Ÿงน Chores
32
+
33
+ * Remove package resolutions and overrides ([#549](https://github.com/DarkSheepSoftware/eslint/issues/549)) ([112c077](https://github.com/DarkSheepSoftware/eslint/commit/112c07794dd13fcce9d23d5c6501a4b6e90d17b3))
34
+
3
35
  ## [5.1.4](https://github.com/DarkSheepSoftware/eslint/compare/v5.1.3...v5.1.4) (2024-07-31)
4
36
 
5
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darksheep/eslint",
3
- "version": "5.1.4",
3
+ "version": "5.2.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/DarkSheepSoftware/eslint"
@@ -13,7 +13,6 @@
13
13
  }
14
14
  },
15
15
  "types": "./types/src/index.d.ts",
16
- "bin": "./src/bin/eslint.cjs",
17
16
  "files": [
18
17
  "src",
19
18
  "types"
@@ -21,26 +20,19 @@
21
20
  "scripts": {
22
21
  "githooks": "git config core.hooksPath .githooks"
23
22
  },
24
- "resolutions": {
25
- "@typescript-eslint/eslint-plugin": "8.0.0",
26
- "@typescript-eslint/parser": "8.0.0",
27
- "@typescript-eslint/type-utils": "^8.0.0-0",
28
- "@typescript-eslint/utils": "^8.0.0-0"
29
- },
30
23
  "dependencies": {
31
24
  "@eslint-community/eslint-plugin-eslint-comments": "4.3.0",
32
25
  "@eslint/eslintrc": "3.1.0",
33
26
  "@eslint/js": "9.8.0",
34
- "@stylistic/eslint-plugin": "2.6.0",
35
- "@typescript-eslint/eslint-plugin": "8.0.0",
36
- "@typescript-eslint/parser": "8.0.0",
27
+ "@stylistic/eslint-plugin": "2.6.1",
28
+ "@typescript-eslint/eslint-plugin": "8.0.1",
29
+ "@typescript-eslint/parser": "8.0.1",
37
30
  "editorconfig": "2.0.0",
38
- "eslint": "9.8.0",
39
- "eslint-plugin-jsdoc": "48.10.2",
31
+ "eslint-plugin-jsdoc": "48.11.0",
40
32
  "eslint-plugin-jsonc": "2.16.0",
41
- "eslint-plugin-n": "17.10.1",
33
+ "eslint-plugin-n": "17.10.2",
42
34
  "eslint-plugin-package-json": "0.15.2",
43
- "eslint-plugin-perfectionist": "3.0.0",
35
+ "eslint-plugin-perfectionist": "3.1.2",
44
36
  "eslint-plugin-promise": "7.0.0",
45
37
  "eslint-plugin-react": "7.35.0",
46
38
  "eslint-plugin-regexp": "2.6.0",
@@ -57,26 +49,24 @@
57
49
  "@types/eslint__js": "~8.42.3",
58
50
  "@types/estree": "~1.0.2",
59
51
  "@types/node": "~20.14.0",
52
+ "eslint": "~9.8.0",
60
53
  "type-fest": "~4.23.0",
61
54
  "typescript": "~5.5.0"
62
55
  },
56
+ "peerDependencies": {
57
+ "eslint": "~9.8.0"
58
+ },
63
59
  "peerDependenciesMeta": {
64
60
  "typescript": {
65
61
  "optional": true
66
62
  }
67
63
  },
68
- "packageManager": "yarn@4.3.1",
64
+ "packageManager": "yarn@4.4.0",
69
65
  "engines": {
70
66
  "node": "^20 || ^21 || ^22"
71
67
  },
72
68
  "volta": {
73
69
  "node": "22.5.1",
74
- "yarn": "4.3.1"
75
- },
76
- "overrides": {
77
- "@typescript-eslint/eslint-plugin": "^8.0.0-0",
78
- "@typescript-eslint/parser": "^8.0.0-0",
79
- "@typescript-eslint/type-utils": "^8.0.0-0",
80
- "@typescript-eslint/utils": "^8.0.0-0"
70
+ "yarn": "4.4.0"
81
71
  }
82
72
  }
@@ -12,7 +12,6 @@ const rules = {
12
12
  'no-implied-eval': 'error',
13
13
  'no-invalid-this': 'error',
14
14
  'no-new-func': 'error',
15
- 'no-process-env': 'off',
16
15
  'no-proto': 'error',
17
16
  'no-script-url': 'error',
18
17
  'no-unexpected-multiline': 'error',
@@ -36,7 +35,7 @@ const rules = {
36
35
  'no-const-assign': 'error',
37
36
  'no-dupe-class-members': 'error',
38
37
  'no-duplicate-imports': 'error',
39
- 'no-new-symbol': 'error',
38
+ 'no-new-native-nonconstructor': 'error',
40
39
  'no-restricted-imports': 'error',
41
40
  'no-this-before-super': 'error',
42
41
  'no-useless-computed-key': 'error',
@@ -67,6 +66,7 @@ const rules = {
67
66
 
68
67
  'eqeqeq': [ 'error', 'always', { null: 'ignore' } ],
69
68
  'no-extra-bind': 'error',
69
+ 'no-loss-of-precision': 'error',
70
70
  'no-useless-call': 'error',
71
71
  'no-useless-catch': 'error',
72
72
  'no-useless-concat': 'error',
@@ -76,7 +76,6 @@ const rules = {
76
76
  'no-octal': 'error',
77
77
  'no-octal-escape': 'error',
78
78
  'no-return-assign': 'error',
79
- 'no-return-await': 'error',
80
79
  'prefer-promise-reject-errors': 'error',
81
80
  'require-await': 'off',
82
81
 
@@ -93,7 +92,7 @@ const rules = {
93
92
  'no-array-constructor': 'error',
94
93
  'no-lonely-if': 'error',
95
94
  'no-negated-condition': 'error',
96
- 'no-new-object': 'error',
95
+ 'no-object-constructor': 'error',
97
96
  'no-nested-ternary': 'warn',
98
97
  'no-unneeded-ternary': 'warn',
99
98
 
@@ -114,6 +113,7 @@ const rules = {
114
113
  */
115
114
  export async function createEslintBaseConfig() {
116
115
  return [ {
116
+ name: 'darksheep/base',
117
117
  linterOptions: {
118
118
  noInlineConfig: false,
119
119
  reportUnusedDisableDirectives: true,
@@ -3,26 +3,29 @@
3
3
  * @returns {import('eslint').Linter.FlatConfig[]}
4
4
  */
5
5
  export function createEslintComplexityConfig() {
6
- return [ { rules: {
7
- 'max-depth': [ 'error', 4 ],
8
- 'complexity': 'off',
9
- 'max-lines': [
10
- 'warn',
11
- {
12
- max: 512,
13
- skipBlankLines: true,
14
- skipComments: true,
15
- },
16
- ],
17
- 'max-lines-per-function': [
18
- 'warn',
19
- {
20
- max: 120,
21
- skipBlankLines: true,
22
- skipComments: true,
23
- },
24
- ],
25
- 'max-nested-callbacks': [ 'warn', 3 ],
26
- 'max-params': [ 'error', 5 ],
27
- } } ];
6
+ return [ {
7
+ name: 'darksheep/complexity',
8
+ rules: {
9
+ 'max-depth': [ 'error', 4 ],
10
+ 'complexity': 'off',
11
+ 'max-lines': [
12
+ 'warn',
13
+ {
14
+ max: 512,
15
+ skipBlankLines: true,
16
+ skipComments: true,
17
+ },
18
+ ],
19
+ 'max-lines-per-function': [
20
+ 'warn',
21
+ {
22
+ max: 120,
23
+ skipBlankLines: true,
24
+ skipComments: true,
25
+ },
26
+ ],
27
+ 'max-nested-callbacks': [ 'warn', 3 ],
28
+ 'max-params': [ 'error', 5 ],
29
+ },
30
+ } ];
28
31
  }
@@ -37,6 +37,7 @@ export async function createEslintIgnoresConfig(root) {
37
37
  const ignores = await getGitignore(root);
38
38
 
39
39
  return [ {
40
+ name: 'darksheep/git-ignores',
40
41
  ignores: [
41
42
  ...ignores,
42
43
 
@@ -5,5 +5,8 @@ import js from '@eslint/js';
5
5
  * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
6
6
  */
7
7
  export async function createEslintRecommendsConfig() {
8
- return [ js.configs.recommended ];
8
+ return [ {
9
+ name: 'eslint/recomended',
10
+ ...js.configs.recommended,
11
+ } ];
9
12
  }
@@ -17,7 +17,10 @@ const rules = {
17
17
  */
18
18
  export async function createStyleConfig(root) {
19
19
  return [
20
- { rules },
20
+ {
21
+ name: 'style/core',
22
+ rules: rules,
23
+ },
21
24
  ...await createEditorOverrides(root),
22
25
  ];
23
26
  }
@@ -7,6 +7,7 @@ import eslintComments from '@eslint-community/eslint-plugin-eslint-comments';
7
7
  export function createEslintCommentsConfig() {
8
8
  return [
9
9
  {
10
+ name: 'eslint-comments/custom',
10
11
  plugins: {
11
12
  'eslint-comments': eslintComments,
12
13
  },
@@ -18,8 +19,8 @@ export function createEslintCommentsConfig() {
18
19
  'eslint-comments/no-unused-disable': 'error',
19
20
  'eslint-comments/no-unused-enable': 'error',
20
21
 
21
- 'line-comment-position': 'off',
22
- 'multiline-comment-style': 'off',
22
+ // 'line-comment-position': 'off',
23
+ // 'multiline-comment-style': 'off',
23
24
  'no-inline-comments': 'off',
24
25
  },
25
26
  },
@@ -14,6 +14,7 @@ export async function createEslintJSDocConfig(root) {
14
14
 
15
15
  return [
16
16
  {
17
+ name: 'jsdoc/javascript',
17
18
  plugins: { jsdoc },
18
19
  settings: {
19
20
  jsdoc: {
@@ -53,6 +54,7 @@ export async function createEslintJSDocConfig(root) {
53
54
  },
54
55
  },
55
56
  {
57
+ name: 'jsdoc/typescript',
56
58
  files: getTypescriptFiles(),
57
59
  rules: {
58
60
  'jsdoc/no-types': 'warn',
@@ -1,8 +1,6 @@
1
1
  import jsonc from 'eslint-plugin-jsonc';
2
2
  import parser from 'jsonc-eslint-parser';
3
3
 
4
- import { getJsonFiles } from '../utilities/eslint-files.js';
5
-
6
4
  /**
7
5
  * Get ESLint config for imports check
8
6
  * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
@@ -10,22 +8,26 @@ import { getJsonFiles } from '../utilities/eslint-files.js';
10
8
  export async function createEslintJsonConfig() {
11
9
  return [
12
10
  {
13
- files: await getJsonFiles(),
11
+ name: 'json/core',
12
+ files: [ '**/*.json', '**/*.jsonc', '**/*.json5' ],
14
13
  languageOptions: { parser },
15
14
  // @ts-expect-error jsonc does not match the plugin interface
16
15
  plugins: { jsonc },
17
16
  },
18
17
  {
18
+ name: 'json/.json',
19
19
  files: [ '**/*.json' ],
20
20
  // @ts-expect-error Record<string, string> vs Record<string, 'error'>
21
21
  rules: jsonc.configs['recommended-with-json'].rules,
22
22
  },
23
23
  {
24
+ name: 'json/.jsonc',
24
25
  files: [ '**/*.jsonc' ],
25
26
  // @ts-expect-error Record<string, string> vs Record<string, 'error'>
26
27
  rules: jsonc.configs['recommended-with-jsonc'].rules,
27
28
  },
28
29
  {
30
+ name: 'json/.json5',
29
31
  files: [ '**/*.json5' ],
30
32
  // @ts-expect-error Record<string, string> vs Record<string, 'error'>
31
33
  rules: jsonc.configs['recommended-with-json5'].rules,
@@ -22,6 +22,7 @@ const commonRules = {
22
22
  'n/callback-return': 'error',
23
23
  'n/handle-callback-err': 'error',
24
24
  'n/no-process-exit': 'warn',
25
+ 'n/no-process-env': 'warn',
25
26
  'n/no-path-concat': 'error',
26
27
 
27
28
  'n/no-callback-literal': 'off',
@@ -77,6 +78,7 @@ export async function createEslintNodeConfig(root) {
77
78
 
78
79
  return [
79
80
  {
81
+ name: 'node/common',
80
82
  files: commonFiles,
81
83
  ignores: exampleFiles,
82
84
  plugins: { n },
@@ -103,6 +105,7 @@ export async function createEslintNodeConfig(root) {
103
105
  },
104
106
  },
105
107
  {
108
+ name: 'node/module-and-typescript',
106
109
  files: [ ...typescriptFiles, ...moduleFiles ],
107
110
  ignores: exampleFiles,
108
111
  plugins: { n },
@@ -128,6 +131,7 @@ export async function createEslintNodeConfig(root) {
128
131
  },
129
132
  },
130
133
  {
134
+ name: 'node/test-files',
131
135
  files: getTestFiles(),
132
136
  plugins: { n },
133
137
  rules: { 'n/no-sync': 'off' },
@@ -8,6 +8,7 @@ import jsoncParser from 'jsonc-eslint-parser';
8
8
  export async function createEslintPackageJsonConfig() {
9
9
  return [
10
10
  {
11
+ name: 'package-json/custom',
11
12
  // @ts-expect-error
12
13
  plugins: { 'package-json': plugin },
13
14
  languageOptions: {
@@ -202,20 +202,18 @@ const typescriptRules = {
202
202
  * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
203
203
  */
204
204
  export async function createEslintPerfectionistConfig(root) {
205
- const commonFiles = await getCommonFiles(root);
206
- const moduleFiles = await getModuleFiles(root);
207
- const typescriptFiles = getTypescriptFiles();
208
-
209
205
  return [
210
206
  {
211
- files: commonFiles,
207
+ name: 'perfectionist/common',
208
+ files: await getCommonFiles(root),
212
209
  plugins: { perfectionist },
213
210
  rules: {
214
211
  ...commonRules,
215
212
  },
216
213
  },
217
214
  {
218
- files: moduleFiles,
215
+ name: 'perfectionist/module',
216
+ files: await getModuleFiles(root),
219
217
  plugins: { perfectionist },
220
218
  rules: {
221
219
  ...commonRules,
@@ -223,7 +221,8 @@ export async function createEslintPerfectionistConfig(root) {
223
221
  },
224
222
  },
225
223
  {
226
- files: typescriptFiles,
224
+ name: 'perfectionist/typescript',
225
+ files: getTypescriptFiles(),
227
226
  plugins: { perfectionist },
228
227
  rules: {
229
228
  ...commonRules,
@@ -6,6 +6,7 @@ import promise from 'eslint-plugin-promise';
6
6
  */
7
7
  export function createEslintPromiseConfig() {
8
8
  return [ {
9
+ name: 'promise/custom',
9
10
  plugins: { promise },
10
11
  rules: {
11
12
  ...promise.configs.recommended.rules,
@@ -98,6 +98,7 @@ export async function createEslintReactConfig(root) {
98
98
 
99
99
  return [
100
100
  {
101
+ name: 'react/jsx',
101
102
  files: [ '**/*.jsx' ],
102
103
  languageOptions: {
103
104
  parserOptions: {
@@ -111,6 +112,7 @@ export async function createEslintReactConfig(root) {
111
112
  rules: rules,
112
113
  },
113
114
  {
115
+ name: 'react/tsx',
114
116
  files: [ '**/*.tsx' ],
115
117
  languageOptions: {
116
118
  parserOptions: {
@@ -1,13 +1,14 @@
1
- import { makeCompat } from '../utilities/make-compat.js';
1
+ import regexp from 'eslint-plugin-regexp';
2
2
 
3
3
  /**
4
4
  * Get ESLint config for the regexp plugin
5
- * @param {import('node:url').URL} root root url
6
5
  * @returns {import('eslint').Linter.FlatConfig[]}
7
6
  */
8
- export function createEslintRegexpConfig(root) {
9
- return makeCompat(root).config({
10
- plugins: [ 'regexp' ],
11
- extends: [ 'plugin:regexp/recommended' ],
12
- });
7
+ export function createEslintRegexpConfig() {
8
+ return [
9
+ {
10
+ name: 'regexp/recommended',
11
+ ...regexp.configs['flat/recommended'],
12
+ },
13
+ ];
13
14
  }
@@ -13,6 +13,7 @@ import {
13
13
  export async function createEslintSCAConfig(root) {
14
14
  return [
15
15
  {
16
+ name: 'sca/javascript',
16
17
  files: [
17
18
  ...await getCommonFiles(root),
18
19
  ...await getModuleFiles(root),
@@ -31,6 +32,7 @@ export async function createEslintSCAConfig(root) {
31
32
  },
32
33
  },
33
34
  {
35
+ name: 'sca/typescript',
34
36
  files: getTypescriptFiles(),
35
37
  plugins: { sca },
36
38
  rules: {
@@ -6,10 +6,19 @@ import security from 'eslint-plugin-security';
6
6
  */
7
7
  export function createEslintSecurityConfig() {
8
8
  return [ {
9
- ...security.configs.recommended,
9
+ name: 'security/recommended',
10
10
  plugins: { security },
11
11
  rules: {
12
+ ...security.configs.recommended.rules,
13
+ 'security/detect-object-injection': 0,
14
+
15
+ // I dont particularly care here..
12
16
  'security/detect-non-literal-fs-filename': 0,
17
+ 'security/detect-non-literal-require': 0,
18
+
19
+ // eslint-plugin-regexp does this better...
20
+ 'security/detect-non-literal-regexp': 0,
21
+ 'security/detect-unsafe-regex': 0,
13
22
  },
14
23
  } ];
15
24
  }
@@ -7,6 +7,7 @@ import sonarjs from 'eslint-plugin-sonarjs';
7
7
  export function createEslintSonarJSConfig() {
8
8
  return [
9
9
  {
10
+ name: 'sonarjs/recommended',
10
11
  plugins: { sonarjs },
11
12
  rules: {
12
13
  ...sonarjs.configs.recommended.rules,
@@ -14,6 +15,7 @@ export function createEslintSonarJSConfig() {
14
15
  },
15
16
  },
16
17
  {
18
+ name: 'sonarjs/tests',
17
19
  files: [
18
20
  '**/*.test.*',
19
21
  '*.test.*',
@@ -7,6 +7,7 @@ import stylistic from '@stylistic/eslint-plugin';
7
7
  */
8
8
  export function createEslintStyleConfig() {
9
9
  return [ {
10
+ name: 'stylistic/custom',
10
11
  plugins: { style: stylistic },
11
12
  rules: {
12
13
  // Require or disallow newline at the end of files
@@ -27,6 +27,7 @@ export async function createEslintTypescriptConfig(root) {
27
27
  const typescriptPlugin = idef(await import('@typescript-eslint/eslint-plugin'));
28
28
 
29
29
  return [ {
30
+ name: 'typescript/custom',
30
31
  files: getTypescriptFiles(),
31
32
  languageOptions: {
32
33
  parser: typescriptParser,
@@ -48,7 +49,7 @@ export async function createEslintTypescriptConfig(root) {
48
49
  'no-dupe-keys': 'off',
49
50
  'no-func-assign': 'off',
50
51
  'no-import-assign': 'off',
51
- 'no-new-symbol': 'off',
52
+ // 'no-new-symbol': 'off',
52
53
  'no-obj-calls': 'off',
53
54
  'no-redeclare': 'off',
54
55
  'no-setter-return': 'off',
@@ -57,7 +58,6 @@ export async function createEslintTypescriptConfig(root) {
57
58
  'no-unreachable': 'off',
58
59
  'no-unsafe-negation': 'off',
59
60
  'no-array-constructor': 'off',
60
- 'no-loss-of-precision': 'off',
61
61
 
62
62
  // Rules that prevert some commmon ts issues
63
63
  'no-var': 'error',
@@ -74,14 +74,13 @@ export async function createEslintTypescriptConfig(root) {
74
74
  '@typescript-eslint/no-duplicate-enum-values': 'error',
75
75
  '@typescript-eslint/no-explicit-any': 'error',
76
76
  '@typescript-eslint/no-extra-non-null-assertion': 'error',
77
- '@typescript-eslint/no-loss-of-precision': 'error',
78
77
  '@typescript-eslint/no-misused-new': 'error',
79
78
  '@typescript-eslint/no-namespace': [ 'error', { allowDeclarations: true } ],
80
79
  '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
81
80
  '@typescript-eslint/no-this-alias': 'error',
82
81
  '@typescript-eslint/no-unnecessary-type-constraint': 'error',
83
82
  '@typescript-eslint/no-unsafe-declaration-merging': 'error',
84
- '@typescript-eslint/no-var-requires': 'error',
83
+ '@typescript-eslint/no-require-imports': 'error',
85
84
  '@typescript-eslint/prefer-as-const': 'error',
86
85
  '@typescript-eslint/triple-slash-reference': 'error',
87
86
  },
@@ -1,20 +1,19 @@
1
- import { makeCompat } from '../utilities/make-compat.js';
1
+ import unicorn from 'eslint-plugin-unicorn';
2
2
 
3
3
  /**
4
4
  * Get ESLint config for the unicorn plugin
5
- * @param {import('node:url').URL} root root url
6
5
  * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
7
6
  */
8
- export async function createEslintUnicornConfig(root) {
9
- return makeCompat(root).config({
10
- plugins: [ 'unicorn' ],
7
+ export async function createEslintUnicornConfig() {
8
+ return [ {
9
+ name: 'unicorn/custom',
10
+ plugins: { unicorn },
11
11
  rules: {
12
12
  /*
13
13
  * Sanity checks
14
14
  */
15
15
  'unicorn/better-regex': 'off',
16
16
  'unicorn/no-empty-file': 'warn',
17
- 'unicorn/no-unsafe-regex': 'off',
18
17
  'unicorn/no-zero-fractions': 'error',
19
18
  'unicorn/no-unreadable-array-destructuring': 'error',
20
19
  'unicorn/no-useless-undefined': 'error',
@@ -54,5 +53,5 @@ export async function createEslintUnicornConfig(root) {
54
53
  'unicorn/require-array-join-separator': 'error',
55
54
  'unicorn/text-encoding-identifier-case': 'error',
56
55
  },
57
- });
56
+ } ];
58
57
  }
@@ -13,6 +13,7 @@ import {
13
13
  export async function createEslintUnusedImportsConfig(root) {
14
14
  return [
15
15
  {
16
+ name: 'no-unused-imports/custom',
16
17
  files: [
17
18
  ...await getModuleFiles(root),
18
19
  ...getTypescriptFiles(),
@@ -195,11 +195,13 @@ export async function createEditorOverrides(root) {
195
195
 
196
196
  if (files.includes('*')) {
197
197
  addOrMergeConfig(configs, {
198
+ name: `editor-config/${extensions.join(', ')}`,
198
199
  files: extensions.map((extension) => `**/*${extension}`),
199
200
  rules: convert(body, rules),
200
201
  });
201
202
  } else {
202
203
  addOrMergeConfig(configs, {
204
+ name: `editor-config/${files.join(', ')}`,
203
205
  files: files.map((file) => `**/${file}`),
204
206
  rules: convert(body, rules),
205
207
  });
@@ -15,14 +15,6 @@ function getFiles(files, type, target) {
15
15
  return files;
16
16
  }
17
17
 
18
- /**
19
- * Get a list of globs for common js files
20
- * @returns {Promise<string[]>}
21
- */
22
- export async function getJsonFiles() {
23
- return [ '**/*.json', '**/*.jsonc', '**/*.json5' ];
24
- }
25
-
26
18
  /**
27
19
  * Get a list of globs for common js files
28
20
  * @param {import('node:url').URL} root root url
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Get ESLint config for the regexp plugin
3
- * @param {import('node:url').URL} root root url
4
3
  * @returns {import('eslint').Linter.FlatConfig[]}
5
4
  */
6
- export function createEslintRegexpConfig(root: import("node:url").URL): import("eslint").Linter.FlatConfig[];
5
+ export function createEslintRegexpConfig(): import("eslint").Linter.FlatConfig[];
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Get ESLint config for the unicorn plugin
3
- * @param {import('node:url').URL} root root url
4
3
  * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
4
  */
6
- export function createEslintUnicornConfig(root: import("node:url").URL): Promise<import("eslint").Linter.FlatConfig[]>;
5
+ export function createEslintUnicornConfig(): Promise<import("eslint").Linter.FlatConfig[]>;
@@ -1,8 +1,3 @@
1
- /**
2
- * Get a list of globs for common js files
3
- * @returns {Promise<string[]>}
4
- */
5
- export function getJsonFiles(): Promise<string[]>;
6
1
  /**
7
2
  * Get a list of globs for common js files
8
3
  * @param {import('node:url').URL} root root url
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const path = require('node:path');
4
-
5
- const ESLINT_BIN_PATH = path.resolve(
6
- require.resolve('eslint'), // eslint api
7
- '../..', // eslint package root
8
- 'bin/eslint.js', // eslint cli
9
- );
10
-
11
- require(ESLINT_BIN_PATH);
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};