@darksheep/eslint 6.4.3 → 6.5.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 +40 -0
- package/package.json +12 -13
- package/src/configs/eslint-base.js +3 -3
- package/src/configs/eslint-complexity.js +2 -2
- package/src/configs/eslint-ignores.js +5 -5
- package/src/configs/eslint-recommended.js +2 -2
- package/src/configs/eslint-style.js +3 -3
- package/src/custom-logger/index.js +20 -11
- package/src/custom-rules/instance-of-array.js +4 -4
- package/src/custom-rules/loose-types.js +52 -52
- package/src/custom-rules/no-useless-expression.js +1 -1
- package/src/custom-rules/sequence-expression.js +1 -1
- package/src/index.js +14 -10
- package/src/plugins/eslint-comments.js +4 -4
- package/src/plugins/jsdoc.js +40 -12
- package/src/plugins/json.js +10 -2
- package/src/plugins/node.js +18 -24
- package/src/plugins/package-json.js +5 -9
- package/src/plugins/perfectionist.js +12 -3
- package/src/plugins/promise.js +6 -2
- package/src/plugins/react.js +3 -3
- package/src/plugins/regexp.js +96 -3
- package/src/plugins/sca.js +3 -3
- package/src/plugins/security.js +2 -2
- package/src/plugins/style.js +61 -208
- package/src/plugins/typescript.js +4 -4
- package/src/plugins/unicorn.js +142 -51
- package/src/plugins/unused-imports.js +3 -3
- package/src/plugins/yml.js +8 -2
- package/src/utilities/editorconfig.js +18 -18
- package/src/utilities/eslint-files.js +10 -10
- package/src/utilities/expand-glob.js +8 -8
- package/src/utilities/filesystem.js +16 -16
- package/src/utilities/package.js +5 -5
- package/types/eslint.config.d.ts +5 -1
- package/types/src/configs/eslint-base.d.ts +3 -3
- package/types/src/configs/eslint-complexity.d.ts +3 -3
- package/types/src/configs/eslint-ignores.d.ts +4 -4
- package/types/src/configs/eslint-recommended.d.ts +3 -3
- package/types/src/configs/eslint-style.d.ts +4 -4
- package/types/src/index.d.ts +3 -3
- package/types/src/plugins/eslint-comments.d.ts +3 -3
- package/types/src/plugins/jsdoc.d.ts +4 -4
- package/types/src/plugins/json.d.ts +3 -3
- package/types/src/plugins/node.d.ts +4 -4
- package/types/src/plugins/package-json.d.ts +3 -3
- package/types/src/plugins/perfectionist.d.ts +4 -4
- package/types/src/plugins/promise.d.ts +3 -3
- package/types/src/plugins/react.d.ts +4 -4
- package/types/src/plugins/regexp.d.ts +3 -3
- package/types/src/plugins/sca.d.ts +4 -4
- package/types/src/plugins/security.d.ts +3 -3
- package/types/src/plugins/style.d.ts +3 -3
- package/types/src/plugins/typescript.d.ts +4 -4
- package/types/src/plugins/unicorn.d.ts +4 -3
- package/types/src/plugins/unused-imports.d.ts +4 -4
- package/types/src/plugins/yml.d.ts +3 -3
- package/types/src/utilities/editorconfig.d.ts +10 -10
- package/types/src/utilities/eslint-files.d.ts +7 -7
- package/types/src/utilities/expand-glob.d.ts +1 -1
- package/types/src/utilities/filesystem.d.ts +16 -16
- package/types/src/utilities/package.d.ts +3 -3
|
@@ -9,17 +9,17 @@ import { findUp } from './filesystem.js';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @typedef {Object} RuleSet
|
|
12
|
-
* @property {string} EOL
|
|
13
|
-
* @property {string} LF
|
|
14
|
-
* @property {string} TRAIL
|
|
15
|
-
* @property {string} INDENT
|
|
16
|
-
* @property {string} [INDENT_BINARY]
|
|
17
|
-
* @property {unknown} [INDENT_OPTIONS]
|
|
12
|
+
* @property {string} EOL End of line.
|
|
13
|
+
* @property {string} LF Line feed.
|
|
14
|
+
* @property {string} TRAIL Trailing spaces.
|
|
15
|
+
* @property {string} INDENT Indent size.
|
|
16
|
+
* @property {string} [INDENT_BINARY] Indent binary ops size.
|
|
17
|
+
* @property {unknown} [INDENT_OPTIONS] Options to pass to the indent rule.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* @param {import('editorconfig').SectionBody} input Raw editor config converted into an object
|
|
22
|
-
* @param {RuleSet} RULES The rules used to create eslint rules options
|
|
21
|
+
* @param {import('editorconfig').SectionBody} input - Raw editor config converted into an object.
|
|
22
|
+
* @param {RuleSet} RULES - The rules used to create eslint rules options.
|
|
23
23
|
* @returns {import('eslint').Linter.RulesRecord}
|
|
24
24
|
*/
|
|
25
25
|
function convert(input, RULES) {
|
|
@@ -51,7 +51,7 @@ function convert(input, RULES) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (input?.indent_style === 'space') {
|
|
54
|
-
const size = Number.parseInt(input?.indent_size ?? 4, 10);
|
|
54
|
+
const size = Number.parseInt(input?.indent_size ?? '4', 10);
|
|
55
55
|
output[RULES.INDENT] = [ 'error', size, RULES.INDENT_OPTIONS ?? {} ];
|
|
56
56
|
if (RULES.INDENT_BINARY != null) {
|
|
57
57
|
output[RULES.INDENT_BINARY] = [ 'error', size ];
|
|
@@ -101,8 +101,8 @@ const extToRules = [
|
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* Do any of the provided files match a js file?
|
|
104
|
-
* @param {string[]} files The list of files to check
|
|
105
|
-
* @param {string[]} extensions The allowed file extensions
|
|
104
|
+
* @param {string[]} files - The list of files to check.
|
|
105
|
+
* @param {string[]} extensions - The allowed file extensions.
|
|
106
106
|
* @returns {string[]}
|
|
107
107
|
*/
|
|
108
108
|
function filterMatchingFiles(files, extensions) {
|
|
@@ -122,8 +122,8 @@ function filterMatchingFiles(files, extensions) {
|
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
124
|
* Do any of the provided files match a js file?
|
|
125
|
-
* @param {string[] | null | undefined} one The list of files to check
|
|
126
|
-
* @param {string[] | null | undefined} two The allowed file extensions
|
|
125
|
+
* @param {string[] | null | undefined} one - The list of files to check.
|
|
126
|
+
* @param {string[] | null | undefined} two - The allowed file extensions.
|
|
127
127
|
* @returns {boolean}
|
|
128
128
|
*/
|
|
129
129
|
function equal(one, two) {
|
|
@@ -152,8 +152,8 @@ function equal(one, two) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
|
-
* @param {import('eslint').Linter.
|
|
156
|
-
* @param {import('eslint').Linter.
|
|
155
|
+
* @param {import('eslint').Linter.Config[]} configs - [description].
|
|
156
|
+
* @param {import('eslint').Linter.Config} config - [description].
|
|
157
157
|
*/
|
|
158
158
|
function addOrMergeConfig(configs, config) {
|
|
159
159
|
for (const previous of configs) {
|
|
@@ -173,8 +173,8 @@ function addOrMergeConfig(configs, config) {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
/**
|
|
176
|
-
* @param {import('node:url').URL} root
|
|
177
|
-
* @returns {Promise<import('eslint').Linter.
|
|
176
|
+
* @param {import('node:url').URL} root - Root url.
|
|
177
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
178
178
|
*/
|
|
179
179
|
export async function createEditorOverrides(root) {
|
|
180
180
|
const eslintConfigPath = resolve(fileURLToPath(root), 'eslint.config.js');
|
|
@@ -185,7 +185,7 @@ export async function createEditorOverrides(root) {
|
|
|
185
185
|
|
|
186
186
|
const editorconfig = parseBuffer(await readFile(path));
|
|
187
187
|
|
|
188
|
-
/** @type {import('eslint').Linter.
|
|
188
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
189
189
|
const configs = [];
|
|
190
190
|
for (const [ name, body ] of editorconfig) {
|
|
191
191
|
if (name === null) {
|
|
@@ -2,9 +2,9 @@ import { expandGlob } from './expand-glob.js';
|
|
|
2
2
|
import { getPackageJson } from './package.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @param {string[]} files
|
|
6
|
-
* @param {string} type
|
|
7
|
-
* @param {string} target
|
|
5
|
+
* @param {string[]} files - [description].
|
|
6
|
+
* @param {string} type - [description].
|
|
7
|
+
* @param {string} target - [description].
|
|
8
8
|
* @returns {string[]}
|
|
9
9
|
*/
|
|
10
10
|
function getFiles(files, type, target) {
|
|
@@ -16,8 +16,8 @@ function getFiles(files, type, target) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Get a list of globs for common js files
|
|
20
|
-
* @param {import('node:url').URL} root
|
|
19
|
+
* Get a list of globs for common js files.
|
|
20
|
+
* @param {import('node:url').URL} root - Root url.
|
|
21
21
|
* @returns {Promise<string[]>}
|
|
22
22
|
*/
|
|
23
23
|
export async function getCommonFiles(root) {
|
|
@@ -27,8 +27,8 @@ export async function getCommonFiles(root) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Get a list of globs for module files
|
|
31
|
-
* @param {import('node:url').URL} root
|
|
30
|
+
* Get a list of globs for module files.
|
|
31
|
+
* @param {import('node:url').URL} root - Root url.
|
|
32
32
|
* @returns {Promise<string[]>}
|
|
33
33
|
*/
|
|
34
34
|
export async function getModuleFiles(root) {
|
|
@@ -37,7 +37,7 @@ export async function getModuleFiles(root) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Get a list of globs for typescript files
|
|
40
|
+
* Get a list of globs for typescript files.
|
|
41
41
|
* @returns {string[]}
|
|
42
42
|
*/
|
|
43
43
|
export function getTypescriptFiles() {
|
|
@@ -45,7 +45,7 @@ export function getTypescriptFiles() {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Get a list of possible example files
|
|
48
|
+
* Get a list of possible example files.
|
|
49
49
|
* @returns {string[]}
|
|
50
50
|
*/
|
|
51
51
|
export function getTestFiles() {
|
|
@@ -58,7 +58,7 @@ export function getTestFiles() {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* Get a list of possible example files
|
|
61
|
+
* Get a list of possible example files.
|
|
62
62
|
* @returns {string[]}
|
|
63
63
|
*/
|
|
64
64
|
export function getExampleFiles() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const globNumRegex = /\{\d+\.\.\d+\}
|
|
2
|
-
const globEachRegex = /\{[\w
|
|
1
|
+
const globNumRegex = /\{\d+\.\.\d+\}/u;
|
|
2
|
+
const globEachRegex = /\{[\w\-.]+(?:,[\w\-.]+)*\}/u;
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @param {string} input The glob to process
|
|
5
|
+
* @param {string} input - The glob to process.
|
|
6
6
|
* @returns {string[]}
|
|
7
7
|
*/
|
|
8
8
|
export function expandGlob(input) {
|
|
@@ -12,20 +12,20 @@ export function expandGlob(input) {
|
|
|
12
12
|
const each = globNumMatch[0];
|
|
13
13
|
const last = input.slice(globNumMatch.index + each.length);
|
|
14
14
|
|
|
15
|
-
const [ a, b ] = each
|
|
15
|
+
const [ a = 0, b = 0 ] = each
|
|
16
16
|
.slice(1, -1)
|
|
17
17
|
.split('..')
|
|
18
18
|
.map((number) => Number.parseInt(number, 10));
|
|
19
19
|
|
|
20
|
-
const start = a
|
|
21
|
-
const end = a
|
|
20
|
+
const start = Math.min(a, b);
|
|
21
|
+
const end = Math.max(a, b);
|
|
22
22
|
|
|
23
23
|
const output = [];
|
|
24
24
|
for (let i = start; i <= end; i++) {
|
|
25
25
|
output.push(`${first}${i}${last}`);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
return output.
|
|
28
|
+
return output.flatMap(expandGlob);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const globEachMatch = input.match(globEachRegex);
|
|
@@ -39,7 +39,7 @@ export function expandGlob(input) {
|
|
|
39
39
|
.map((part) => `${first}${part}${last}`);
|
|
40
40
|
|
|
41
41
|
if (output.length > 1) {
|
|
42
|
-
return output.
|
|
42
|
+
return output.flatMap(expandGlob);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
return output;
|
|
@@ -2,7 +2,7 @@ import { stat } from 'node:fs/promises';
|
|
|
2
2
|
import * as Path from 'node:path';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @param {string} path The absolute path to the file to check
|
|
5
|
+
* @param {string} path - The absolute path to the file to check.
|
|
6
6
|
* @returns {Promise<boolean>}
|
|
7
7
|
*/
|
|
8
8
|
export async function exists(path) {
|
|
@@ -15,9 +15,9 @@ export async function exists(path) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Does {filePath} exist in {projectPath}
|
|
19
|
-
* @param {string} [filePath] The path of the file to check
|
|
20
|
-
* @param {string} [projectPath] The path to the project root
|
|
18
|
+
* Does {filePath} exist in {projectPath}.
|
|
19
|
+
* @param {string} [filePath] - The path of the file to check.
|
|
20
|
+
* @param {string} [projectPath] - The path to the project root.
|
|
21
21
|
* @returns {boolean}
|
|
22
22
|
*/
|
|
23
23
|
export function descendsFrom(filePath, projectPath) {
|
|
@@ -32,9 +32,9 @@ export function descendsFrom(filePath, projectPath) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Create a list of parent directories from {filepath} to {stopDirectory}
|
|
36
|
-
* @param {string} filepath The file to start from
|
|
37
|
-
* @param {string} [stopDirectory] The directory to stop at
|
|
35
|
+
* Create a list of parent directories from {filepath} to {stopDirectory}.
|
|
36
|
+
* @param {string} filepath - The file to start from.
|
|
37
|
+
* @param {string} [stopDirectory] - The directory to stop at.
|
|
38
38
|
* @returns {string[]}
|
|
39
39
|
*/
|
|
40
40
|
export function listParents(filepath, stopDirectory = '/') {
|
|
@@ -54,10 +54,10 @@ export function listParents(filepath, stopDirectory = '/') {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* Find the closest {filename} starting from {rootFilePath}
|
|
58
|
-
* @param {string[]} paths The paths to search in
|
|
59
|
-
* @param {string} filename The filename to find
|
|
60
|
-
* @returns {Promise<string|null>} Returns absolute path to the closest {filename} if found
|
|
57
|
+
* Find the closest {filename} starting from {rootFilePath}.
|
|
58
|
+
* @param {string[]} paths - The paths to search in.
|
|
59
|
+
* @param {string} filename - The filename to find.
|
|
60
|
+
* @returns {Promise<string|null>} Returns absolute path to the closest {filename} if found.
|
|
61
61
|
*/
|
|
62
62
|
export async function findInPaths(paths, filename) {
|
|
63
63
|
for (const directory of paths) {
|
|
@@ -72,11 +72,11 @@ export async function findInPaths(paths, filename) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
|
-
* Find the closest {filename} starting from {rootFilePath}
|
|
76
|
-
* @param {string} rootFilePath The file to start the search from
|
|
77
|
-
* @param {string} filename The filename to find
|
|
78
|
-
* @param {string} [stopDirectory] The directory to stop searching at
|
|
79
|
-
* @returns {Promise<string|null>} Returns absolute path to the closest {filename} if found
|
|
75
|
+
* Find the closest {filename} starting from {rootFilePath}.
|
|
76
|
+
* @param {string} rootFilePath - The file to start the search from.
|
|
77
|
+
* @param {string} filename - The filename to find.
|
|
78
|
+
* @param {string} [stopDirectory] - The directory to stop searching at.
|
|
79
|
+
* @returns {Promise<string|null>} Returns absolute path to the closest {filename} if found.
|
|
80
80
|
*/
|
|
81
81
|
export async function findUp(rootFilePath, filename, stopDirectory = Path.resolve('/')) {
|
|
82
82
|
return findInPaths(listParents(rootFilePath, stopDirectory), filename);
|
package/src/utilities/package.js
CHANGED
|
@@ -12,8 +12,8 @@ const errorCodesToSkip = new Set([
|
|
|
12
12
|
const cache = new Map();
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @param {string} rootPath The root url
|
|
16
|
-
* @param {string} packageName The target package name
|
|
15
|
+
* @param {string} rootPath - The root url.
|
|
16
|
+
* @param {string} packageName - The target package name.
|
|
17
17
|
* @returns {string[]}
|
|
18
18
|
*/
|
|
19
19
|
function modulePaths(rootPath, packageName) {
|
|
@@ -22,9 +22,9 @@ function modulePaths(rootPath, packageName) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Get the path of the eslint package json
|
|
26
|
-
* @param {import('node:url').URL} rootUrl The root url of the module
|
|
27
|
-
* @param {string} [packageName] The name of the npm package
|
|
25
|
+
* Get the path of the eslint package json.
|
|
26
|
+
* @param {import('node:url').URL} rootUrl - The root url of the module.
|
|
27
|
+
* @param {string} [packageName] - The name of the npm package.
|
|
28
28
|
* @returns {Promise<import('type-fest').PackageJson | null>}
|
|
29
29
|
*/
|
|
30
30
|
export async function getPackageJson(rootUrl, packageName) {
|
package/types/eslint.config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get the ESLint base config
|
|
3
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get the ESLint base config.
|
|
3
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintBaseConfig(): Promise<import("eslint").Linter.
|
|
5
|
+
export function createEslintBaseConfig(): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get the ESLint config for complexity checks
|
|
3
|
-
* @returns {import('eslint').Linter.
|
|
2
|
+
* Get the ESLint config for complexity checks.
|
|
3
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintComplexityConfig(): import("eslint").Linter.
|
|
5
|
+
export function createEslintComplexityConfig(): import("eslint").Linter.Config[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get basic ESLint ignores config
|
|
3
|
-
* @param {import('node:url').URL} root
|
|
4
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get basic ESLint ignores config.
|
|
3
|
+
* @param {import('node:url').URL} root - Root url.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
5
5
|
*/
|
|
6
|
-
export function createEslintIgnoresConfig(root: import("node:url").URL): Promise<import("eslint").Linter.
|
|
6
|
+
export function createEslintIgnoresConfig(root: import("node:url").URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get recommended ESLint config
|
|
3
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get recommended ESLint config.
|
|
3
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintRecommendsConfig(): Promise<import("eslint").Linter.
|
|
5
|
+
export function createEslintRecommendsConfig(): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get basic ESLint style config
|
|
3
|
-
* @param {import('node:url').URL} root
|
|
4
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get basic ESLint style config.
|
|
3
|
+
* @param {import('node:url').URL} root - Root url.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
5
5
|
*/
|
|
6
|
-
export function createStyleConfig(root: import("node:url").URL): Promise<import("eslint").Linter.
|
|
6
|
+
export function createStyleConfig(root: import("node:url").URL): Promise<import("eslint").Linter.Config[]>;
|
package/types/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {string | import('node:url').URL} root
|
|
3
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* @param {string | import('node:url').URL} root - Root url.
|
|
3
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
4
4
|
*/
|
|
5
|
-
export function createConfig(root: string | import("node:url").URL): Promise<import("eslint").Linter.
|
|
5
|
+
export function createConfig(root: string | import("node:url").URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for comments check
|
|
3
|
-
* @returns {import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for comments check.
|
|
3
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintCommentsConfig(): import("eslint").Linter.
|
|
5
|
+
export function createEslintCommentsConfig(): import("eslint").Linter.Config[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for
|
|
3
|
-
* @param {URL} root The root of the package being linted
|
|
4
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for JSDoc.
|
|
3
|
+
* @param {URL} root - The root of the package being linted.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
5
5
|
*/
|
|
6
|
-
export function createEslintJSDocConfig(root: URL): Promise<import("eslint").Linter.
|
|
6
|
+
export function createEslintJSDocConfig(root: URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for imports check
|
|
3
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for imports check.
|
|
3
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintJsonConfig(): Promise<import("eslint").Linter.
|
|
5
|
+
export function createEslintJsonConfig(): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the node plugin
|
|
3
|
-
* @param {URL} root
|
|
4
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for the node plugin.
|
|
3
|
+
* @param {URL} root - Root url.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
5
5
|
*/
|
|
6
|
-
export function createEslintNodeConfig(root: URL): Promise<import("eslint").Linter.
|
|
6
|
+
export function createEslintNodeConfig(root: URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the regexp plugin
|
|
3
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for the regexp plugin.
|
|
3
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintPackageJsonConfig(): Promise<import("eslint").Linter.
|
|
5
|
+
export function createEslintPackageJsonConfig(): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for imports check
|
|
3
|
-
* @param {URL} root The root of the package being linted
|
|
4
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for imports check.
|
|
3
|
+
* @param {URL} root - The root of the package being linted.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
5
5
|
*/
|
|
6
|
-
export function createEslintPerfectionistConfig(root: URL): Promise<import("eslint").Linter.
|
|
6
|
+
export function createEslintPerfectionistConfig(root: URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the promise plugin
|
|
3
|
-
* @returns {import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for the promise plugin.
|
|
3
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintPromiseConfig(): import("eslint").Linter.
|
|
5
|
+
export function createEslintPromiseConfig(): import("eslint").Linter.Config[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for imports check
|
|
3
|
-
* @param {URL} root The root of the package being linted
|
|
4
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for imports check.
|
|
3
|
+
* @param {URL} root - The root of the package being linted.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
5
5
|
*/
|
|
6
|
-
export function createEslintReactConfig(root: URL): Promise<import("eslint").Linter.
|
|
6
|
+
export function createEslintReactConfig(root: URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the regexp plugin
|
|
3
|
-
* @returns {import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for the regexp plugin.
|
|
3
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintRegexpConfig(): import("eslint").Linter.
|
|
5
|
+
export function createEslintRegexpConfig(): import("eslint").Linter.Config[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the sca plugin
|
|
3
|
-
* @param {URL} root The root url of the package we are linting
|
|
4
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for the sca plugin.
|
|
3
|
+
* @param {URL} root - The root url of the package we are linting.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
5
5
|
*/
|
|
6
|
-
export function createEslintSCAConfig(root: URL): Promise<import("eslint").Linter.
|
|
6
|
+
export function createEslintSCAConfig(root: URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the security plugin
|
|
3
|
-
* @returns {import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for the security plugin.
|
|
3
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintSecurityConfig(): import("eslint").Linter.
|
|
5
|
+
export function createEslintSecurityConfig(): import("eslint").Linter.Config[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the style plugin
|
|
3
|
-
* @returns {import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for the style plugin.
|
|
3
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintStyleConfig(): import("eslint").Linter.
|
|
5
|
+
export function createEslintStyleConfig(): import("eslint").Linter.Config[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the typescript plugin
|
|
3
|
-
* @param {import('node:url').URL} root
|
|
4
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for the typescript plugin.
|
|
3
|
+
* @param {import('node:url').URL} root - Root url.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
5
5
|
*/
|
|
6
|
-
export function createEslintTypescriptConfig(root: import("node:url").URL): Promise<import("eslint").Linter.
|
|
6
|
+
export function createEslintTypescriptConfig(root: import("node:url").URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the unicorn plugin
|
|
3
|
-
* @
|
|
2
|
+
* Get ESLint config for the unicorn plugin.
|
|
3
|
+
* @param {URL} root - Root url.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
4
5
|
*/
|
|
5
|
-
export function createEslintUnicornConfig(): Promise<import("eslint").Linter.
|
|
6
|
+
export function createEslintUnicornConfig(root: URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for the unused import plugin
|
|
3
|
-
* @param {import('node:url').URL} root
|
|
4
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for the unused import plugin.
|
|
3
|
+
* @param {import('node:url').URL} root - Root url.
|
|
4
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
5
5
|
*/
|
|
6
|
-
export function createEslintUnusedImportsConfig(root: import("node:url").URL): Promise<import("eslint").Linter.
|
|
6
|
+
export function createEslintUnusedImportsConfig(root: import("node:url").URL): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get ESLint config for yml check
|
|
3
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* Get ESLint config for yml check.
|
|
3
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
4
4
|
*/
|
|
5
|
-
export function createEslintYmlConfig(): Promise<import("eslint").Linter.
|
|
5
|
+
export function createEslintYmlConfig(): Promise<import("eslint").Linter.Config[]>;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {import('node:url').URL} root
|
|
3
|
-
* @returns {Promise<import('eslint').Linter.
|
|
2
|
+
* @param {import('node:url').URL} root - Root url.
|
|
3
|
+
* @returns {Promise<import('eslint').Linter.Config[]>}
|
|
4
4
|
*/
|
|
5
|
-
export function createEditorOverrides(root: import("node:url").URL): Promise<import("eslint").Linter.
|
|
5
|
+
export function createEditorOverrides(root: import("node:url").URL): Promise<import("eslint").Linter.Config[]>;
|
|
6
6
|
export type RuleSet = {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* End of line.
|
|
9
9
|
*/
|
|
10
10
|
EOL: string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Line feed.
|
|
13
13
|
*/
|
|
14
14
|
LF: string;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Trailing spaces.
|
|
17
17
|
*/
|
|
18
18
|
TRAIL: string;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Indent size.
|
|
21
21
|
*/
|
|
22
22
|
INDENT: string;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Indent binary ops size.
|
|
25
25
|
*/
|
|
26
|
-
INDENT_BINARY?: string
|
|
26
|
+
INDENT_BINARY?: string;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Options to pass to the indent rule.
|
|
29
29
|
*/
|
|
30
30
|
INDENT_OPTIONS?: unknown;
|
|
31
31
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get a list of globs for common js files
|
|
3
|
-
* @param {import('node:url').URL} root
|
|
2
|
+
* Get a list of globs for common js files.
|
|
3
|
+
* @param {import('node:url').URL} root - Root url.
|
|
4
4
|
* @returns {Promise<string[]>}
|
|
5
5
|
*/
|
|
6
6
|
export function getCommonFiles(root: import("node:url").URL): Promise<string[]>;
|
|
7
7
|
/**
|
|
8
|
-
* Get a list of globs for module files
|
|
9
|
-
* @param {import('node:url').URL} root
|
|
8
|
+
* Get a list of globs for module files.
|
|
9
|
+
* @param {import('node:url').URL} root - Root url.
|
|
10
10
|
* @returns {Promise<string[]>}
|
|
11
11
|
*/
|
|
12
12
|
export function getModuleFiles(root: import("node:url").URL): Promise<string[]>;
|
|
13
13
|
/**
|
|
14
|
-
* Get a list of globs for typescript files
|
|
14
|
+
* Get a list of globs for typescript files.
|
|
15
15
|
* @returns {string[]}
|
|
16
16
|
*/
|
|
17
17
|
export function getTypescriptFiles(): string[];
|
|
18
18
|
/**
|
|
19
|
-
* Get a list of possible example files
|
|
19
|
+
* Get a list of possible example files.
|
|
20
20
|
* @returns {string[]}
|
|
21
21
|
*/
|
|
22
22
|
export function getTestFiles(): string[];
|
|
23
23
|
/**
|
|
24
|
-
* Get a list of possible example files
|
|
24
|
+
* Get a list of possible example files.
|
|
25
25
|
* @returns {string[]}
|
|
26
26
|
*/
|
|
27
27
|
export function getExampleFiles(): string[];
|