@solvro/config 1.0.2 → 1.0.4
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/bin/index.js +2 -0
- package/dist/chunk-4C4AR77R.js +65 -0
- package/dist/chunk-SND5ODI2.js +20878 -0
- package/dist/dist-2ZVVVZXY.js +35994 -0
- package/dist/eslint-config/cli.cjs +538 -0
- package/dist/eslint-config/cli.d.cts +2 -0
- package/dist/eslint-config/cli.d.ts +2 -0
- package/dist/eslint-config/cli.js +504 -0
- package/dist/eslint-config/index.cjs +73016 -0
- package/dist/eslint-config/index.d.cts +9489 -0
- package/dist/eslint-config/index.d.ts +9489 -0
- package/dist/eslint-config/index.js +15604 -0
- package/dist/eslint-plugin-react-refresh-MJ7ZDK5R.js +258 -0
- package/dist/prettier-config/index.cjs +47 -0
- package/dist/prettier-config/index.d.cts +17 -0
- package/dist/prettier-config/index.d.ts +17 -0
- package/{prettier → dist/prettier-config}/index.js +21 -19
- package/package.json +76 -34
- package/eslint/_base.js +0 -39
- package/eslint/browser.js +0 -6
- package/eslint/comments.js +0 -6
- package/eslint/constants.js +0 -4
- package/eslint/jest-react.js +0 -9
- package/eslint/jest.js +0 -16
- package/eslint/next.js +0 -18
- package/eslint/node.js +0 -6
- package/eslint/playwright-test.js +0 -7
- package/eslint/react.js +0 -16
- package/eslint/rules/best-practice.js +0 -227
- package/eslint/rules/es6.js +0 -65
- package/eslint/rules/import.js +0 -58
- package/eslint/rules/jest.js +0 -16
- package/eslint/rules/jsx-a11y.js +0 -14
- package/eslint/rules/playwright-test.js +0 -46
- package/eslint/rules/possible-errors.js +0 -35
- package/eslint/rules/react.js +0 -97
- package/eslint/rules/stylistic.js +0 -74
- package/eslint/rules/tsdoc.js +0 -11
- package/eslint/rules/typescript/extension.js +0 -38
- package/eslint/rules/typescript/import.js +0 -16
- package/eslint/rules/typescript/index.js +0 -93
- package/eslint/rules/unicorn.js +0 -22
- package/eslint/rules/variables.js +0 -30
- package/eslint/rules/vitest.js +0 -16
- package/eslint/typescript.js +0 -23
- package/eslint/utils/require-package.js +0 -36
- package/eslint/vitest.js +0 -3
- package/typescript/tsconfig.base.json +0 -13
- package/typescript/tsconfig.node16.json +0 -12
- package/typescript/tsconfig.node18.json +0 -12
- package/typescript/tsconfig.node20.json +0 -12
@@ -1,74 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
rules: {
|
3
|
-
/**
|
4
|
-
* Require camel case names.
|
5
|
-
*
|
6
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/camelcase
|
7
|
-
*/
|
8
|
-
camelcase: [
|
9
|
-
"error",
|
10
|
-
{ allow: ["^UNSAFE_"], ignoreDestructuring: false, properties: "never" },
|
11
|
-
],
|
12
|
-
/**
|
13
|
-
* Require function expressions to have a name.
|
14
|
-
*
|
15
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/func-names
|
16
|
-
*/
|
17
|
-
"func-names": ["error", "as-needed"],
|
18
|
-
/**
|
19
|
-
* Require a capital letter for constructors.
|
20
|
-
*
|
21
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/new-cap
|
22
|
-
*/
|
23
|
-
"new-cap": ["error", { capIsNew: false }],
|
24
|
-
/**
|
25
|
-
* Disallow the omission of parentheses when invoking a constructor with
|
26
|
-
* no arguments.
|
27
|
-
*
|
28
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/new-parens
|
29
|
-
*/
|
30
|
-
"new-parens": "warn",
|
31
|
-
/**
|
32
|
-
* Disallow use of the Array constructor.
|
33
|
-
*
|
34
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-array-constructor
|
35
|
-
*/
|
36
|
-
"no-array-constructor": "error",
|
37
|
-
/**
|
38
|
-
* Disallow use of bitwise operators.
|
39
|
-
*
|
40
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-bitwise
|
41
|
-
*/
|
42
|
-
"no-bitwise": "error",
|
43
|
-
/**
|
44
|
-
* Disallow if as the only statement in an else block.
|
45
|
-
*
|
46
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/no-lonely-if
|
47
|
-
*/
|
48
|
-
"no-lonely-if": "warn",
|
49
|
-
/**
|
50
|
-
* Disallow use of chained assignment expressions.
|
51
|
-
*
|
52
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-multi-assign
|
53
|
-
*/
|
54
|
-
"no-multi-assign": ["error"],
|
55
|
-
/**
|
56
|
-
* Disallow nested ternary expressions.
|
57
|
-
*
|
58
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-nested-ternary
|
59
|
-
*/
|
60
|
-
"no-nested-ternary": "error",
|
61
|
-
/**
|
62
|
-
* Disallow ternary operators when simpler alternatives exist.
|
63
|
-
*
|
64
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-unneeded-ternary
|
65
|
-
*/
|
66
|
-
"no-unneeded-ternary": "error",
|
67
|
-
/**
|
68
|
-
* Require use of an object spread over Object.assign.
|
69
|
-
*
|
70
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/prefer-object-spread
|
71
|
-
*/
|
72
|
-
"prefer-object-spread": "warn",
|
73
|
-
},
|
74
|
-
};
|
package/eslint/rules/tsdoc.js
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
plugins: ["eslint-plugin-tsdoc"],
|
3
|
-
rules: {
|
4
|
-
/**
|
5
|
-
* Require TSDoc comments conform to the TSDoc specification.
|
6
|
-
*
|
7
|
-
* 🚫 Not fixable - https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
|
8
|
-
*/
|
9
|
-
"tsdoc/syntax": "error",
|
10
|
-
},
|
11
|
-
};
|
@@ -1,38 +0,0 @@
|
|
1
|
-
// These share identical configuration options, so we want to keep them in sync.
|
2
|
-
const noUnusedVarsConfig = require("../variables").rules["no-unused-vars"];
|
3
|
-
|
4
|
-
module.exports = {
|
5
|
-
rules: {
|
6
|
-
/**
|
7
|
-
* Require default parameters to be last.
|
8
|
-
*
|
9
|
-
* 🚫 Not fixable - https://typescript-eslint.io/rules/default-param-last/
|
10
|
-
*/
|
11
|
-
"@typescript-eslint/default-param-last": "error",
|
12
|
-
/**
|
13
|
-
* Disallow creation of functions within loops.
|
14
|
-
*
|
15
|
-
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-loop-func/
|
16
|
-
*/
|
17
|
-
"@typescript-eslint/no-loop-func": "error",
|
18
|
-
/**
|
19
|
-
* Disallow variable declarations from shadowing variables declared in the
|
20
|
-
* outer scope.
|
21
|
-
*
|
22
|
-
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-shadow/
|
23
|
-
*/
|
24
|
-
"@typescript-eslint/no-shadow": "error",
|
25
|
-
/**
|
26
|
-
* Disallow unused variables.
|
27
|
-
*
|
28
|
-
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-unused-vars/
|
29
|
-
*/
|
30
|
-
"@typescript-eslint/no-unused-vars": noUnusedVarsConfig,
|
31
|
-
/**
|
32
|
-
* Disallow unnecessary constructors.
|
33
|
-
*
|
34
|
-
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-useless-constructor/
|
35
|
-
*/
|
36
|
-
"@typescript-eslint/no-useless-constructor": "error",
|
37
|
-
},
|
38
|
-
};
|
@@ -1,16 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* These are enabled by `import/recommended`, but are better handled by
|
3
|
-
* TypeScript and @typescript-eslint.
|
4
|
-
*/
|
5
|
-
const disabledRules = {
|
6
|
-
"import/default": "off",
|
7
|
-
"import/export": "off",
|
8
|
-
"import/namespace": "off",
|
9
|
-
"import/no-unresolved": "off",
|
10
|
-
};
|
11
|
-
|
12
|
-
module.exports = {
|
13
|
-
rules: {
|
14
|
-
...disabledRules,
|
15
|
-
},
|
16
|
-
};
|
@@ -1,93 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
rules: {
|
3
|
-
/**
|
4
|
-
* Require consistent usage of type exports.
|
5
|
-
*
|
6
|
-
* 🔧 Fixable - https://typescript-eslint.io/rules/consistent-type-exports/
|
7
|
-
*/
|
8
|
-
"@typescript-eslint/consistent-type-exports": [
|
9
|
-
"warn",
|
10
|
-
{ fixMixedExportsWithInlineTypeSpecifier: true },
|
11
|
-
],
|
12
|
-
/**
|
13
|
-
* Require consistent usage of type imports.
|
14
|
-
*
|
15
|
-
* 🔧 Fixable - https://typescript-eslint.io/rules/consistent-type-imports/
|
16
|
-
*/
|
17
|
-
"@typescript-eslint/consistent-type-imports": [
|
18
|
-
"warn",
|
19
|
-
{
|
20
|
-
disallowTypeAnnotations: true,
|
21
|
-
fixStyle: "inline-type-imports",
|
22
|
-
prefer: "type-imports",
|
23
|
-
},
|
24
|
-
],
|
25
|
-
/**
|
26
|
-
* Require using function property types in method signatures.
|
27
|
-
*
|
28
|
-
* These have enhanced typechecking, whereas method signatures do not.
|
29
|
-
*
|
30
|
-
* 🔧 Fixable - https://typescript-eslint.io/rules/method-signature-style/
|
31
|
-
*/
|
32
|
-
"@typescript-eslint/method-signature-style": "warn",
|
33
|
-
/**
|
34
|
-
* Require consistent naming conventions.
|
35
|
-
*
|
36
|
-
* Improves IntelliSense suggestions and avoids name collisions.
|
37
|
-
*
|
38
|
-
* 🚫 Not fixable - https://typescript-eslint.io/rules/naming-convention/
|
39
|
-
*/
|
40
|
-
"@typescript-eslint/naming-convention": [
|
41
|
-
"error",
|
42
|
-
// Anything type-like should be written in PascalCase.
|
43
|
-
{
|
44
|
-
format: ["PascalCase"],
|
45
|
-
selector: ["typeLike", "enumMember"],
|
46
|
-
},
|
47
|
-
// Interfaces cannot be prefixed with `I`, or have restricted names.
|
48
|
-
{
|
49
|
-
custom: {
|
50
|
-
match: false,
|
51
|
-
regex: "^I[A-Z]|^(Interface|Props|State)$",
|
52
|
-
},
|
53
|
-
format: ["PascalCase"],
|
54
|
-
selector: "interface",
|
55
|
-
},
|
56
|
-
],
|
57
|
-
/**
|
58
|
-
* Disallow members of unions and intersections that do nothing or override type information.
|
59
|
-
*
|
60
|
-
* 🚫 Not fixable - https://typescript-eslint.io/rules/no-redundant-type-constituents/
|
61
|
-
*/
|
62
|
-
"@typescript-eslint/no-redundant-type-constituents": "warn",
|
63
|
-
/**
|
64
|
-
* Disallow unnecessary namespace qualifiers.
|
65
|
-
*
|
66
|
-
* 🔧 Fixable - https://typescript-eslint.io/rules/no-unnecessary-qualifier/
|
67
|
-
*/
|
68
|
-
"@typescript-eslint/no-unnecessary-qualifier": "warn",
|
69
|
-
/**
|
70
|
-
* Require using `RegExp.exec()` over `String.match()` for consistency.
|
71
|
-
*
|
72
|
-
* 🔧 Fixable - https://typescript-eslint.io/rules/prefer-regexp-exec/
|
73
|
-
*/
|
74
|
-
"@typescript-eslint/prefer-regexp-exec": "warn",
|
75
|
-
/**
|
76
|
-
* Require Array#sort calls to provide a compare function.
|
77
|
-
*
|
78
|
-
* 🚫 Not fixable - https://typescript-eslint.io/rules/require-array-sort-compare/
|
79
|
-
*/
|
80
|
-
"@typescript-eslint/require-array-sort-compare": [
|
81
|
-
"error",
|
82
|
-
{ ignoreStringArrays: true },
|
83
|
-
],
|
84
|
-
/**
|
85
|
-
* Require exhaustive checks when using union types in switch statements.
|
86
|
-
*
|
87
|
-
* This ensures cases are considered when items are later added to a union.
|
88
|
-
*
|
89
|
-
* 🚫 Not fixable - https://typescript-eslint.io/rules/switch-exhaustiveness-check/
|
90
|
-
*/
|
91
|
-
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
92
|
-
},
|
93
|
-
};
|
package/eslint/rules/unicorn.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
plugins: ["unicorn"],
|
3
|
-
rules: {
|
4
|
-
/**
|
5
|
-
* Require consistent filename case for all linted files.
|
6
|
-
*
|
7
|
-
* 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
|
8
|
-
*/
|
9
|
-
"unicorn/filename-case": [
|
10
|
-
"error",
|
11
|
-
{
|
12
|
-
case: "kebabCase",
|
13
|
-
},
|
14
|
-
],
|
15
|
-
/**
|
16
|
-
* Require using the `node:` protocol when importing Node.js built-in modules.
|
17
|
-
*
|
18
|
-
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
19
|
-
*/
|
20
|
-
"unicorn/prefer-node-protocol": "warn",
|
21
|
-
},
|
22
|
-
};
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
rules: {
|
3
|
-
/**
|
4
|
-
* Disallow labels that share a name with a variable.
|
5
|
-
*
|
6
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-label-var
|
7
|
-
*/
|
8
|
-
"no-label-var": "error",
|
9
|
-
/**
|
10
|
-
* Disallow initializing variables to `undefined`.
|
11
|
-
*
|
12
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/no-undef-init
|
13
|
-
*/
|
14
|
-
"no-undef-init": "warn",
|
15
|
-
/**
|
16
|
-
* Disallow unused variables.
|
17
|
-
*
|
18
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-unused-vars
|
19
|
-
*/ "no-unused-vars": [
|
20
|
-
"error",
|
21
|
-
{
|
22
|
-
args: "after-used",
|
23
|
-
argsIgnorePattern: "^_",
|
24
|
-
ignoreRestSiblings: false,
|
25
|
-
vars: "all",
|
26
|
-
varsIgnorePattern: "^_",
|
27
|
-
},
|
28
|
-
],
|
29
|
-
},
|
30
|
-
};
|
package/eslint/rules/vitest.js
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
rules: {
|
3
|
-
/**
|
4
|
-
* Disallow duplicate setup and teardown hooks.
|
5
|
-
*
|
6
|
-
* 🚫 Not fixable - https://github.com/veritem/eslint-plugin-vitest/blob/HEAD/docs/rules/no-duplicate-hooks.md
|
7
|
-
*/
|
8
|
-
"vitest/no-duplicate-hooks": "error",
|
9
|
-
/**
|
10
|
-
* Require lowercase test names.
|
11
|
-
*
|
12
|
-
* 🔧 Fixable - https://github.com/veritem/eslint-plugin-vitest/blob/HEAD/docs/rules/prefer-lowercase-title.md
|
13
|
-
*/
|
14
|
-
"vitest/prefer-lowercase-title": "warn",
|
15
|
-
},
|
16
|
-
};
|
package/eslint/typescript.js
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
const { TYPESCRIPT_FILES } = require("./constants");
|
2
|
-
const requirePackage = require("./utils/require-package");
|
3
|
-
|
4
|
-
requirePackage("typescript", "typescript");
|
5
|
-
|
6
|
-
module.exports = {
|
7
|
-
overrides: [
|
8
|
-
{
|
9
|
-
files: TYPESCRIPT_FILES,
|
10
|
-
extends: [
|
11
|
-
"plugin:@typescript-eslint/recommended-type-checked",
|
12
|
-
"plugin:@typescript-eslint/strict-type-checked",
|
13
|
-
"plugin:@typescript-eslint/stylistic-type-checked",
|
14
|
-
"plugin:import/typescript",
|
15
|
-
"prettier",
|
16
|
-
require.resolve("./rules/typescript"),
|
17
|
-
require.resolve("./rules/typescript/extension"),
|
18
|
-
require.resolve("./rules/typescript/import"),
|
19
|
-
require.resolve("./rules/tsdoc"),
|
20
|
-
],
|
21
|
-
},
|
22
|
-
],
|
23
|
-
};
|
@@ -1,36 +0,0 @@
|
|
1
|
-
// @ts-check
|
2
|
-
const pkgJson = require("../../package.json");
|
3
|
-
|
4
|
-
const log = (message = "") => process.stderr.write(`${message}\n`);
|
5
|
-
|
6
|
-
/**
|
7
|
-
* @returns {string} The name of the package manager.
|
8
|
-
*/
|
9
|
-
function 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 (e) {
|
22
|
-
const packageManager = readPackageManager();
|
23
|
-
const command = packageManager === "yarn" ? "add" : "install";
|
24
|
-
|
25
|
-
log(
|
26
|
-
`The \`${configName}\` config requires an optional peer dependency, which has not been installed.`,
|
27
|
-
);
|
28
|
-
log();
|
29
|
-
log("To install it, run:");
|
30
|
-
log(
|
31
|
-
`- ${packageManager} ${command} ${packageName}@${pkgJson.peerDependencies[packageName]}`,
|
32
|
-
);
|
33
|
-
|
34
|
-
process.exit(1);
|
35
|
-
}
|
36
|
-
};
|
package/eslint/vitest.js
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
3
|
-
"display": "Solvro Base",
|
4
|
-
"docs": "https://github.com/solvro/style-guide",
|
5
|
-
"compilerOptions": {
|
6
|
-
"esModuleInterop": true,
|
7
|
-
"forceConsistentCasingInFileNames": true,
|
8
|
-
"noFallthroughCasesInSwitch": true,
|
9
|
-
"noUncheckedIndexedAccess": true,
|
10
|
-
"skipLibCheck": true,
|
11
|
-
"strict": true
|
12
|
-
}
|
13
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
3
|
-
"extends": "./tsconfig.base.json",
|
4
|
-
"display": "Solvro Node 16",
|
5
|
-
"docs": "https://github.com/solvro/style-guide",
|
6
|
-
"compilerOptions": {
|
7
|
-
"lib": ["es2021"],
|
8
|
-
"module": "node16",
|
9
|
-
"target": "es2021",
|
10
|
-
"moduleResolution": "node16"
|
11
|
-
}
|
12
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
3
|
-
"extends": "./tsconfig.base.json",
|
4
|
-
"display": "Solvro Node 18",
|
5
|
-
"docs": "https://github.com/solvro/style-guide",
|
6
|
-
"compilerOptions": {
|
7
|
-
"lib": ["es2023"],
|
8
|
-
"module": "node16",
|
9
|
-
"target": "es2022",
|
10
|
-
"moduleResolution": "node16"
|
11
|
-
}
|
12
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
3
|
-
"extends": "./tsconfig.base.json",
|
4
|
-
"display": "Solvro Node 20",
|
5
|
-
"docs": "https://github.com/solvro/style-guide",
|
6
|
-
"compilerOptions": {
|
7
|
-
"lib": ["es2023"],
|
8
|
-
"module": "node16",
|
9
|
-
"target": "es2022",
|
10
|
-
"moduleResolution": "node16"
|
11
|
-
}
|
12
|
-
}
|