@nihalgonsalves/esconfig 0.7.1 → 0.8.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/.eslintrc.js +9 -9
- package/.eslintrc.react.js +21 -21
- package/.prettierrc.js +4 -3
- package/eslint-rules-base.js +46 -46
- package/package.json +5 -5
- package/tsconfig.json +10 -3
package/.eslintrc.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
/** @type import('eslint-define-config').ESLintConfig */
|
|
4
4
|
module.exports = {
|
|
5
|
-
parser:
|
|
6
|
-
plugins: [
|
|
5
|
+
parser: "@typescript-eslint/parser",
|
|
6
|
+
plugins: ["@typescript-eslint", "import"],
|
|
7
7
|
parserOptions: {
|
|
8
|
-
project:
|
|
8
|
+
project: "./**/tsconfig*.json",
|
|
9
9
|
warnOnUnsupportedTypeScriptVersion: false,
|
|
10
10
|
},
|
|
11
11
|
extends: [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
"eslint:recommended",
|
|
13
|
+
"airbnb-typescript/base",
|
|
14
|
+
"plugin:@typescript-eslint/strict-type-checked",
|
|
15
|
+
"plugin:import/typescript",
|
|
16
|
+
"prettier",
|
|
17
17
|
],
|
|
18
|
-
rules: require(
|
|
18
|
+
rules: require("./eslint-rules-base"),
|
|
19
19
|
};
|
package/.eslintrc.react.js
CHANGED
|
@@ -2,36 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
/** @type import('eslint-define-config').ESLintConfig */
|
|
4
4
|
module.exports = {
|
|
5
|
-
parser:
|
|
6
|
-
plugins: [
|
|
5
|
+
parser: "@typescript-eslint/parser",
|
|
6
|
+
plugins: ["@typescript-eslint", "import", "react"],
|
|
7
7
|
parserOptions: {
|
|
8
|
-
project:
|
|
8
|
+
project: "./**/tsconfig*.json",
|
|
9
9
|
warnOnUnsupportedTypeScriptVersion: false,
|
|
10
10
|
},
|
|
11
11
|
settings: {
|
|
12
|
-
react: { version:
|
|
12
|
+
react: { version: "detect" },
|
|
13
13
|
},
|
|
14
14
|
extends: [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
"eslint:recommended",
|
|
16
|
+
"airbnb-typescript",
|
|
17
|
+
"airbnb/hooks",
|
|
18
|
+
"plugin:react/recommended",
|
|
19
|
+
"plugin:@typescript-eslint/strict-type-checked",
|
|
20
|
+
"plugin:import/typescript",
|
|
21
|
+
"prettier",
|
|
22
22
|
],
|
|
23
23
|
rules: {
|
|
24
|
-
...require(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
...require("./eslint-rules-base"),
|
|
25
|
+
"react/state-in-constructor": ["error", "never"],
|
|
26
|
+
"react/static-property-placement": ["error", "static public field"],
|
|
27
|
+
"react/react-in-jsx-scope": "off",
|
|
28
28
|
// Not a problem with TypeScript
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
"react/jsx-props-no-spreading": "off",
|
|
30
|
+
"react/require-default-props": "off",
|
|
31
|
+
"react/jsx-no-useless-fragment": ["error", { allowExpressions: true }],
|
|
32
|
+
"react/no-array-index-key": "error",
|
|
33
|
+
"react/jsx-key": [
|
|
34
|
+
"error",
|
|
35
35
|
{
|
|
36
36
|
checkFragmentShorthand: true,
|
|
37
37
|
checkKeyMustBeforeSpread: true,
|
package/.prettierrc.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/** @type{import('prettier').Config} */
|
|
4
|
+
module.exports = {};
|
package/eslint-rules-base.js
CHANGED
|
@@ -3,69 +3,69 @@
|
|
|
3
3
|
|
|
4
4
|
/** @type import('eslint-define-config').Rules */
|
|
5
5
|
module.exports = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
"import/prefer-default-export": "off",
|
|
7
|
+
"import/no-default-export": "error",
|
|
8
|
+
"import/order": [
|
|
9
|
+
"error",
|
|
10
10
|
{
|
|
11
11
|
pathGroups: [
|
|
12
12
|
{
|
|
13
|
-
pattern:
|
|
14
|
-
group:
|
|
15
|
-
position:
|
|
13
|
+
pattern: "@nihalgonsalves/**",
|
|
14
|
+
group: "internal",
|
|
15
|
+
position: "after",
|
|
16
16
|
},
|
|
17
17
|
],
|
|
18
|
-
pathGroupsExcludedImportTypes: [
|
|
18
|
+
pathGroupsExcludedImportTypes: ["builtin"],
|
|
19
19
|
groups: [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
"builtin",
|
|
21
|
+
"external",
|
|
22
|
+
"internal",
|
|
23
|
+
"unknown",
|
|
24
|
+
"parent",
|
|
25
|
+
"sibling",
|
|
26
|
+
"index",
|
|
27
27
|
],
|
|
28
|
-
|
|
29
|
-
alphabetize: { order:
|
|
28
|
+
"newlines-between": "always",
|
|
29
|
+
alphabetize: { order: "asc" },
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{ ignoreRestSiblings: true, argsIgnorePattern:
|
|
32
|
+
"func-style": ["error", "expression"],
|
|
33
|
+
"arrow-body-style": "error",
|
|
34
|
+
"object-shorthand": "error",
|
|
35
|
+
"no-useless-rename": "error",
|
|
36
|
+
"@typescript-eslint/no-unused-vars": [
|
|
37
|
+
"error",
|
|
38
|
+
{ ignoreRestSiblings: true, argsIgnorePattern: "^_" },
|
|
39
39
|
],
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{ fixStyle:
|
|
40
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
41
|
+
"error",
|
|
42
|
+
{ fixStyle: "inline-type-imports" },
|
|
43
43
|
],
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
45
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
46
|
+
"error",
|
|
47
47
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
"ts-expect-error": "allow-with-description",
|
|
49
|
+
"ts-ignore": true,
|
|
50
|
+
"ts-nocheck": true,
|
|
51
|
+
"ts-check": false,
|
|
52
52
|
},
|
|
53
53
|
],
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
55
|
+
"error",
|
|
56
56
|
{
|
|
57
|
-
assertionStyle:
|
|
57
|
+
assertionStyle: "never",
|
|
58
58
|
},
|
|
59
59
|
],
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
"@typescript-eslint/strict-boolean-expressions": [
|
|
61
|
+
"error",
|
|
62
62
|
{ allowNullableBoolean: true, allowNullableString: true },
|
|
63
63
|
],
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
65
|
+
"@typescript-eslint/promise-function-async": "error",
|
|
66
|
+
"@typescript-eslint/method-signature-style": "error",
|
|
67
|
+
"@typescript-eslint/naming-convention": "error",
|
|
68
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
69
|
+
"@typescript-eslint/require-array-sort-compare": "error",
|
|
70
|
+
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
71
71
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nihalgonsalves/esconfig",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Shared ECMAScript Config (TS, Lint, Prettier)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "git@github.com:nihalgonsalves/esconfig.git",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"prepare": "husky install"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
25
|
-
"@typescript-eslint/parser": "^6.
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "^6.18.0",
|
|
25
|
+
"@typescript-eslint/parser": "^6.18.0",
|
|
26
26
|
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
27
27
|
"eslint-config-prettier": "^9.0.0",
|
|
28
28
|
"eslint-plugin-import": "^2.29.1",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"eslint-plugin-react-hooks": "^4.6.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@commitlint/cli": "^18.
|
|
35
|
-
"@commitlint/config-conventional": "^18.
|
|
34
|
+
"@commitlint/cli": "^18.4.4",
|
|
35
|
+
"@commitlint/config-conventional": "^18.4.4",
|
|
36
36
|
"eslint": "^8.56.0",
|
|
37
37
|
"eslint-define-config": "^2.1.0",
|
|
38
38
|
"husky": "^8.0.3",
|
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"incremental": true,
|
|
4
3
|
"target": "es2022",
|
|
5
4
|
"module": "es2022",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"moduleDetection": "force",
|
|
7
|
+
|
|
8
|
+
"types": [],
|
|
9
|
+
|
|
6
10
|
"sourceMap": true,
|
|
7
11
|
"strict": true,
|
|
12
|
+
"incremental": true,
|
|
13
|
+
|
|
8
14
|
"noFallthroughCasesInSwitch": true,
|
|
9
15
|
"noImplicitOverride": true,
|
|
10
16
|
"noImplicitReturns": true,
|
|
@@ -13,9 +19,10 @@
|
|
|
13
19
|
"noUnusedLocals": true,
|
|
14
20
|
"noUnusedParameters": true,
|
|
15
21
|
"exactOptionalPropertyTypes": true,
|
|
16
|
-
"moduleResolution": "node",
|
|
17
22
|
"allowSyntheticDefaultImports": true,
|
|
18
23
|
"esModuleInterop": true,
|
|
19
|
-
|
|
24
|
+
|
|
25
|
+
"forceConsistentCasingInFileNames": true,
|
|
26
|
+
"verbatimModuleSyntax": true
|
|
20
27
|
}
|
|
21
28
|
}
|