@haltcase/style 6.2.1 → 7.0.0-canary.10
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/eslint/configs/browser.js +27 -0
- package/eslint/configs/cjs.js +13 -0
- package/eslint/configs/internal/base.js +178 -0
- package/eslint/configs/internal/commonjs.js +22 -0
- package/eslint/{rules → configs/internal}/es2015.js +17 -16
- package/eslint/configs/internal/simple-import-sort.js +27 -0
- package/eslint/configs/internal/tsdoc.js +20 -0
- package/eslint/{rules → configs/internal}/unicorn.js +118 -126
- package/eslint/configs/next.js +50 -0
- package/eslint/configs/node.js +27 -0
- package/eslint/configs/playwright-test.js +21 -0
- package/eslint/configs/react.js +109 -0
- package/eslint/configs/typescript.js +106 -0
- package/eslint/constants.js +23 -28
- package/eslint/index.js +33 -0
- package/eslint/rules/best-practice.js +250 -245
- package/eslint/rules/imports.js +94 -0
- package/eslint/rules/jsx-a11y.js +11 -10
- package/eslint/rules/playwright-test.js +25 -26
- package/eslint/rules/possible-errors.js +38 -45
- package/eslint/rules/react-x.js +78 -0
- package/eslint/rules/react.js +20 -113
- package/eslint/rules/stylistic-jsx.js +17 -0
- package/eslint/rules/stylistic.js +83 -84
- package/eslint/rules/typescript/extension.js +68 -39
- package/eslint/rules/typescript/import.js +16 -15
- package/eslint/rules/typescript/index.js +110 -121
- package/eslint/rules/typescript/naming-convention.js +121 -0
- package/eslint/rules/variables.js +34 -34
- package/eslint/withFiles.js +15 -0
- package/package.json +53 -59
- package/prettier/index.js +4 -11
- package/readme.md +183 -98
- package/stylelint/_base.js +2 -4
- package/stylelint/index.js +6 -7
- package/stylelint/modules.js +7 -8
- package/stylelint/standard.js +2 -5
- package/typescript/tsconfig.base.json +2 -1
- package/typescript/tsconfig.bundler.json +7 -3
- package/typescript/tsconfig.next.json +14 -6
- package/typescript/tsconfig.node.json +1 -1
- package/typescript/tsconfig.node18.json +4 -7
- package/typescript/tsconfig.node20.json +4 -7
- package/typescript/tsconfig.node22.json +10 -0
- package/typescript/tsconfig.web.json +1 -1
- package/eslint/_base.js +0 -82
- package/eslint/astro.js +0 -40
- package/eslint/browser.js +0 -8
- package/eslint/cjs.js +0 -12
- package/eslint/jest.js +0 -28
- package/eslint/next.js +0 -38
- package/eslint/node.js +0 -8
- package/eslint/playwright-test.js +0 -8
- package/eslint/react.js +0 -18
- package/eslint/rules/import.js +0 -92
- package/eslint/rules/jest.js +0 -28
- package/eslint/rules/simple-import-sort.js +0 -23
- package/eslint/rules/tsdoc.js +0 -17
- package/eslint/rules/typescript/strict.js +0 -18
- package/eslint/typescript.js +0 -26
- package/eslint/utils/require-package.js +0 -44
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"extends": "./tsconfig.base.json",
|
|
4
4
|
"compilerOptions": {
|
|
5
|
-
"lib": ["
|
|
5
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
6
6
|
"jsx": "react-jsx",
|
|
7
|
-
"module": "
|
|
7
|
+
"module": "esnext",
|
|
8
8
|
"moduleResolution": "bundler",
|
|
9
9
|
"noEmit": true,
|
|
10
|
+
"allowImportingTsExtensions": true,
|
|
10
11
|
"resolveJsonModule": true,
|
|
11
|
-
"target": "
|
|
12
|
+
"target": "es2020",
|
|
13
|
+
"paths": {
|
|
14
|
+
"@/*": ["${configDir}/src/*"]
|
|
15
|
+
}
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -7,20 +7,28 @@
|
|
|
7
7
|
"incremental": true,
|
|
8
8
|
"isolatedModules": true,
|
|
9
9
|
"jsx": "preserve",
|
|
10
|
-
"lib": ["
|
|
11
|
-
"module": "
|
|
12
|
-
"moduleResolution": "
|
|
10
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
13
|
"noEmit": true,
|
|
14
14
|
"resolveJsonModule": true,
|
|
15
15
|
"skipLibCheck": true,
|
|
16
16
|
"strict": true,
|
|
17
|
-
"target": "
|
|
17
|
+
"target": "ES2022",
|
|
18
|
+
"paths": {
|
|
19
|
+
"@/*": ["${configDir}/src/*"]
|
|
20
|
+
},
|
|
18
21
|
"plugins": [
|
|
19
22
|
{
|
|
20
23
|
"name": "next"
|
|
21
24
|
}
|
|
22
25
|
]
|
|
23
26
|
},
|
|
24
|
-
"include": [
|
|
25
|
-
|
|
27
|
+
"include": [
|
|
28
|
+
"${configDir}/next-env.d.ts",
|
|
29
|
+
"${configDir}/**/*.ts",
|
|
30
|
+
"${configDir}/**/*.tsx",
|
|
31
|
+
"${configDir}/.next/types/**/*.ts"
|
|
32
|
+
],
|
|
33
|
+
"exclude": ["${configDir}/**/node_modules"]
|
|
26
34
|
}
|
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"extends": "./tsconfig.base.json",
|
|
4
4
|
"compilerOptions": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"moduleResolution": "
|
|
9
|
-
"resolveJsonModule": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"target": "ES2022"
|
|
5
|
+
"lib": ["es2023"],
|
|
6
|
+
"module": "node16",
|
|
7
|
+
"target": "es2022",
|
|
8
|
+
"moduleResolution": "node16"
|
|
12
9
|
}
|
|
13
10
|
}
|
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"extends": "./tsconfig.base.json",
|
|
4
4
|
"compilerOptions": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"moduleResolution": "
|
|
9
|
-
"resolveJsonModule": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"target": "ES2022"
|
|
5
|
+
"lib": ["es2023"],
|
|
6
|
+
"module": "node16",
|
|
7
|
+
"target": "es2022",
|
|
8
|
+
"moduleResolution": "node16"
|
|
12
9
|
}
|
|
13
10
|
}
|
package/eslint/_base.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
configFiles,
|
|
5
|
-
ecmaVersion,
|
|
6
|
-
javascriptFiles,
|
|
7
|
-
levels: { off },
|
|
8
|
-
scriptFiles,
|
|
9
|
-
commonJsOverrides
|
|
10
|
-
} = require("./constants");
|
|
11
|
-
|
|
12
|
-
// see https://github.com/eslint/eslint/issues/3458
|
|
13
|
-
require("@rushstack/eslint-patch/modern-module-resolution");
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* This is the base for both our browser and Node ESLint config files.
|
|
17
|
-
*/
|
|
18
|
-
module.exports = {
|
|
19
|
-
extends: [
|
|
20
|
-
"eslint:recommended",
|
|
21
|
-
"plugin:import/recommended",
|
|
22
|
-
"plugin:eslint-comments/recommended",
|
|
23
|
-
"prettier",
|
|
24
|
-
require.resolve("./rules/best-practice"),
|
|
25
|
-
require.resolve("./rules/es2015"),
|
|
26
|
-
require.resolve("./rules/import"),
|
|
27
|
-
require.resolve("./rules/possible-errors"),
|
|
28
|
-
require.resolve("./rules/simple-import-sort"),
|
|
29
|
-
require.resolve("./rules/stylistic"),
|
|
30
|
-
require.resolve("./rules/unicorn"),
|
|
31
|
-
require.resolve("./rules/variables")
|
|
32
|
-
],
|
|
33
|
-
env: {
|
|
34
|
-
[`es${ecmaVersion}`]: true
|
|
35
|
-
},
|
|
36
|
-
// Report unused `eslint-disable` comments.
|
|
37
|
-
reportUnusedDisableDirectives: true,
|
|
38
|
-
// Tell ESLint not to ignore dot-files, which are ignored by default.
|
|
39
|
-
ignorePatterns: ["!.*.js"],
|
|
40
|
-
// Global settings used by all overrides.
|
|
41
|
-
settings: {
|
|
42
|
-
// Use the Node resolver by default.
|
|
43
|
-
"import/resolver": { node: {} }
|
|
44
|
-
},
|
|
45
|
-
// Global parser options.
|
|
46
|
-
parserOptions: {
|
|
47
|
-
ecmaVersion,
|
|
48
|
-
sourceType: "module"
|
|
49
|
-
},
|
|
50
|
-
overrides: [
|
|
51
|
-
{
|
|
52
|
-
files: javascriptFiles,
|
|
53
|
-
parser: "@babel/eslint-parser",
|
|
54
|
-
parserOptions: {
|
|
55
|
-
requireConfigFile: false
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
// config files for third-party tools likely require default exports
|
|
60
|
-
// (e.g., next.config.mjs)
|
|
61
|
-
{
|
|
62
|
-
files: configFiles,
|
|
63
|
-
rules: {
|
|
64
|
-
"import/no-default-export": off
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
// development-only helper scripts & prisma database scripts
|
|
69
|
-
{
|
|
70
|
-
files: scriptFiles,
|
|
71
|
-
rules: {
|
|
72
|
-
"no-console": "off",
|
|
73
|
-
"unicorn/no-process-exit": "off"
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
files: ["**/*.cjs"],
|
|
79
|
-
...commonJsOverrides
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
};
|
package/eslint/astro.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
levels: { error },
|
|
5
|
-
astroFiles
|
|
6
|
-
} = require("./constants");
|
|
7
|
-
const checkForPackage = require("./utils/require-package");
|
|
8
|
-
|
|
9
|
-
checkForPackage("astro", "eslint-plugin-astro");
|
|
10
|
-
|
|
11
|
-
module.exports = {
|
|
12
|
-
extends: ["plugin:astro/recommended"],
|
|
13
|
-
overrides: [
|
|
14
|
-
{
|
|
15
|
-
files: astroFiles,
|
|
16
|
-
parser: "astro-eslint-parser",
|
|
17
|
-
parserOptions: {
|
|
18
|
-
parser: "@typescript-eslint/parser",
|
|
19
|
-
extraFileExtensions: [".astro"]
|
|
20
|
-
},
|
|
21
|
-
rules: {
|
|
22
|
-
// override/add rules settings here, such as:
|
|
23
|
-
// "astro/no-set-html-directive": "error"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
files: ["./src/env.d.ts"],
|
|
28
|
-
rules: {
|
|
29
|
-
"unicorn/prevent-abbreviations": [
|
|
30
|
-
error,
|
|
31
|
-
{
|
|
32
|
-
allowList: {
|
|
33
|
-
env: true
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
};
|
package/eslint/browser.js
DELETED
package/eslint/cjs.js
DELETED
package/eslint/jest.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
levels: { off, error },
|
|
5
|
-
typescriptFiles
|
|
6
|
-
} = require("./constants");
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
plugins: ["testing-library"],
|
|
10
|
-
extends: [
|
|
11
|
-
"plugin:jest/recommended",
|
|
12
|
-
// We may want to separate this out in future, as it's only needed when
|
|
13
|
-
// using React with Testing Library.
|
|
14
|
-
"plugin:testing-library/react",
|
|
15
|
-
require.resolve("./rules/jest")
|
|
16
|
-
],
|
|
17
|
-
overrides: [
|
|
18
|
-
// Prefer the Jest version of this rule. This silently fails when type
|
|
19
|
-
// information is not available.
|
|
20
|
-
{
|
|
21
|
-
files: typescriptFiles,
|
|
22
|
-
rules: {
|
|
23
|
-
"@typescript-eslint/unbound-method": off,
|
|
24
|
-
"jest/unbound-method": error
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
};
|
package/eslint/next.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
javascriptFiles,
|
|
5
|
-
levels: { off },
|
|
6
|
-
nextJsPageFiles,
|
|
7
|
-
nextJsApiRoutes
|
|
8
|
-
} = require("./constants");
|
|
9
|
-
const checkForPackage = require("./utils/require-package");
|
|
10
|
-
|
|
11
|
-
checkForPackage("next", "@next/eslint-plugin-next");
|
|
12
|
-
|
|
13
|
-
const babelOptions = {
|
|
14
|
-
presets: (() => {
|
|
15
|
-
try {
|
|
16
|
-
require.resolve("next/babel");
|
|
17
|
-
return ["next/babel"];
|
|
18
|
-
} catch {
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
})()
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
module.exports = {
|
|
25
|
-
extends: ["plugin:@next/next/recommended"],
|
|
26
|
-
overrides: [
|
|
27
|
-
{
|
|
28
|
-
files: javascriptFiles,
|
|
29
|
-
parserOptions: { babelOptions }
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
files: [...nextJsPageFiles, ...nextJsApiRoutes],
|
|
33
|
-
rules: {
|
|
34
|
-
"import/no-default-export": off
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
};
|
package/eslint/node.js
DELETED
package/eslint/react.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
extends: [
|
|
5
|
-
"plugin:react/recommended",
|
|
6
|
-
"plugin:react-hooks/recommended",
|
|
7
|
-
"plugin:jsx-a11y/recommended",
|
|
8
|
-
"plugin:import/react",
|
|
9
|
-
"prettier",
|
|
10
|
-
require.resolve("./rules/react"),
|
|
11
|
-
require.resolve("./rules/jsx-a11y")
|
|
12
|
-
],
|
|
13
|
-
settings: {
|
|
14
|
-
react: {
|
|
15
|
-
version: "detect"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
package/eslint/rules/import.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
levels: { off, warn, error }
|
|
5
|
-
} = require("../constants");
|
|
6
|
-
|
|
7
|
-
const disabledRules = {
|
|
8
|
-
/**
|
|
9
|
-
* Enforce a module import order convention.
|
|
10
|
-
* This is disabled as it is covered by `eslint-plugin-simple-import-sort`.
|
|
11
|
-
*
|
|
12
|
-
* 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
13
|
-
*/
|
|
14
|
-
"import/order": off
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
module.exports = {
|
|
18
|
-
rules: {
|
|
19
|
-
...disabledRules,
|
|
20
|
-
/**
|
|
21
|
-
* Disallow non-import statements appearing before import statements.
|
|
22
|
-
*
|
|
23
|
-
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
|
|
24
|
-
*/
|
|
25
|
-
"import/first": error,
|
|
26
|
-
/**
|
|
27
|
-
* Require a newline after the last import/require.
|
|
28
|
-
*
|
|
29
|
-
* 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
|
|
30
|
-
*/
|
|
31
|
-
"import/newline-after-import": warn,
|
|
32
|
-
/**
|
|
33
|
-
* Disallow import of modules using absolute paths.
|
|
34
|
-
*
|
|
35
|
-
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
|
|
36
|
-
*/
|
|
37
|
-
"import/no-absolute-path": error,
|
|
38
|
-
/**
|
|
39
|
-
* Disallow cyclical dependencies between modules.
|
|
40
|
-
*
|
|
41
|
-
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
|
|
42
|
-
*/
|
|
43
|
-
"import/no-cycle": error,
|
|
44
|
-
/**
|
|
45
|
-
* Disallow default exports.
|
|
46
|
-
*
|
|
47
|
-
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
|
|
48
|
-
*/
|
|
49
|
-
"import/no-default-export": error,
|
|
50
|
-
/**
|
|
51
|
-
* Combine separate imports of resolved paths.
|
|
52
|
-
*
|
|
53
|
-
* 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md
|
|
54
|
-
*/
|
|
55
|
-
"import/no-duplicates": [
|
|
56
|
-
error,
|
|
57
|
-
{
|
|
58
|
-
considerQueryString: true
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
/**
|
|
62
|
-
* Disallow the use of extraneous packages.
|
|
63
|
-
*
|
|
64
|
-
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
|
|
65
|
-
*/
|
|
66
|
-
"import/no-extraneous-dependencies": [error, { includeTypes: true }],
|
|
67
|
-
/**
|
|
68
|
-
* Disallow mutable exports.
|
|
69
|
-
*
|
|
70
|
-
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
|
|
71
|
-
*/
|
|
72
|
-
"import/no-mutable-exports": error,
|
|
73
|
-
/**
|
|
74
|
-
* Disallow importing packages through relative paths.
|
|
75
|
-
*
|
|
76
|
-
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
|
|
77
|
-
*/
|
|
78
|
-
"import/no-relative-packages": warn,
|
|
79
|
-
/**
|
|
80
|
-
* Disallow a module from importing itself.
|
|
81
|
-
*
|
|
82
|
-
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
|
|
83
|
-
*/
|
|
84
|
-
"import/no-self-import": error,
|
|
85
|
-
/**
|
|
86
|
-
* Ensures that there are no useless path segments.
|
|
87
|
-
*
|
|
88
|
-
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
|
|
89
|
-
*/
|
|
90
|
-
"import/no-useless-path-segments": [error]
|
|
91
|
-
}
|
|
92
|
-
};
|
package/eslint/rules/jest.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
levels: { warn, error }
|
|
5
|
-
} = require("../constants");
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
rules: {
|
|
9
|
-
/**
|
|
10
|
-
* Disallow duplicate setup and teardown hooks.
|
|
11
|
-
*
|
|
12
|
-
* 🚫 Not fixable - https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-duplicate-hooks.md
|
|
13
|
-
*/
|
|
14
|
-
"jest/no-duplicate-hooks": error,
|
|
15
|
-
/**
|
|
16
|
-
* Require lowercase test names.
|
|
17
|
-
*
|
|
18
|
-
* 🔧 Fixable - https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-lowercase-title.md
|
|
19
|
-
*/
|
|
20
|
-
"jest/prefer-lowercase-title": warn,
|
|
21
|
-
/**
|
|
22
|
-
* Require test cases and hooks to be inside a `describe` block.
|
|
23
|
-
*
|
|
24
|
-
* 🚫 Not fixable - https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-top-level-describe.md
|
|
25
|
-
*/
|
|
26
|
-
"jest/require-top-level-describe": error
|
|
27
|
-
}
|
|
28
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
levels: { error }
|
|
5
|
-
} = require("../constants");
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
plugins: ["simple-import-sort"],
|
|
9
|
-
rules: {
|
|
10
|
-
/**
|
|
11
|
-
* Enforce export sort order.
|
|
12
|
-
*
|
|
13
|
-
* 🔧 Fixable - https://github.com/lydell/eslint-plugin-simple-import-sort#exports
|
|
14
|
-
*/
|
|
15
|
-
"simple-import-sort/exports": error,
|
|
16
|
-
/**
|
|
17
|
-
* Enforce import sort order.
|
|
18
|
-
*
|
|
19
|
-
* 🔧 Fixable - https://github.com/lydell/eslint-plugin-simple-import-sort#imports
|
|
20
|
-
*/
|
|
21
|
-
"simple-import-sort/imports": error
|
|
22
|
-
}
|
|
23
|
-
};
|
package/eslint/rules/tsdoc.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
levels: { error }
|
|
5
|
-
} = require("../constants");
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
plugins: ["eslint-plugin-tsdoc"],
|
|
9
|
-
rules: {
|
|
10
|
-
/**
|
|
11
|
-
* Require TSDoc comments conform to the TSDoc specification.
|
|
12
|
-
*
|
|
13
|
-
* 🚫 Not fixable - https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
|
|
14
|
-
*/
|
|
15
|
-
"tsdoc/syntax": error
|
|
16
|
-
}
|
|
17
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
levels: { off }
|
|
5
|
-
} = require("../../constants");
|
|
6
|
-
|
|
7
|
-
const disabledRules = {
|
|
8
|
-
// This is disabled as we feel that checking empty strings is a valid use
|
|
9
|
-
// of `||` over `??`. We'll track this related issue:
|
|
10
|
-
// https://github.com/typescript-eslint/typescript-eslint/issues/4906
|
|
11
|
-
"@typescript-eslint/prefer-nullish-coalescing": off
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
rules: {
|
|
16
|
-
...disabledRules
|
|
17
|
-
}
|
|
18
|
-
};
|
package/eslint/typescript.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { typescriptFiles } = require("./constants");
|
|
4
|
-
const checkForPackage = require("./utils/require-package");
|
|
5
|
-
|
|
6
|
-
checkForPackage("typescript", "typescript");
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
overrides: [
|
|
10
|
-
{
|
|
11
|
-
files: typescriptFiles,
|
|
12
|
-
extends: [
|
|
13
|
-
"plugin:@typescript-eslint/recommended-type-checked",
|
|
14
|
-
"plugin:@typescript-eslint/strict-type-checked",
|
|
15
|
-
"plugin:@typescript-eslint/stylistic-type-checked",
|
|
16
|
-
"plugin:import/typescript",
|
|
17
|
-
"prettier",
|
|
18
|
-
require.resolve("./rules/typescript"),
|
|
19
|
-
require.resolve("./rules/typescript/extension"),
|
|
20
|
-
require.resolve("./rules/typescript/import"),
|
|
21
|
-
require.resolve("./rules/typescript/strict"),
|
|
22
|
-
require.resolve("./rules/tsdoc")
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
const packageJson = require("../../package.json");
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @returns {string} The name of the package manager.
|
|
8
|
-
*/
|
|
9
|
-
const readPackageManager = () => {
|
|
10
|
-
const match = process.env.npm_config_user_agent?.match(/^(?<pm>\w+)\//);
|
|
11
|
-
return match?.groups ? match.groups?.pm : "npm";
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @param {string} configName
|
|
16
|
-
* @param {string} packageName
|
|
17
|
-
*/
|
|
18
|
-
module.exports = (configName, packageName) => {
|
|
19
|
-
try {
|
|
20
|
-
require.resolve(packageName);
|
|
21
|
-
} catch {
|
|
22
|
-
const packageManager = readPackageManager();
|
|
23
|
-
const command =
|
|
24
|
-
packageManager === "yarn" || packageManager === "pnpm"
|
|
25
|
-
? "add"
|
|
26
|
-
: "install";
|
|
27
|
-
|
|
28
|
-
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
29
|
-
const dev = packageManager === "yarn" ? "--dev" : "--save-dev";
|
|
30
|
-
|
|
31
|
-
/* eslint-disable no-console */
|
|
32
|
-
console.error(
|
|
33
|
-
`The \`${configName}\` config requires an optional peer dependency, which has not been installed.`
|
|
34
|
-
);
|
|
35
|
-
console.error();
|
|
36
|
-
console.error("To install it, run:");
|
|
37
|
-
console.error(
|
|
38
|
-
`- ${packageManager} ${command} ${dev} ${packageName}@${packageJson.peerDependencies[packageName]}`
|
|
39
|
-
);
|
|
40
|
-
/* eslint-enable no-console */
|
|
41
|
-
|
|
42
|
-
throw new Error(`Missing dependency encountered: ${packageName}`);
|
|
43
|
-
}
|
|
44
|
-
};
|