@ofk/eslint-config 0.0.15 → 0.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/dist/index.js +23 -4
- package/dist/index.mjs +23 -4
- package/package.json +29 -23
package/dist/index.js
CHANGED
|
@@ -71,6 +71,7 @@ var importsStrict = mergeRules(
|
|
|
71
71
|
},
|
|
72
72
|
// https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#static-analysis
|
|
73
73
|
{
|
|
74
|
+
"import/enforce-node-protocol-usage": "error",
|
|
74
75
|
"import/no-absolute-path": "error",
|
|
75
76
|
"import/no-cycle": "error",
|
|
76
77
|
"import/no-dynamic-require": "error",
|
|
@@ -162,7 +163,11 @@ function imports({
|
|
|
162
163
|
rules: {
|
|
163
164
|
"import/no-nodejs-modules": "off"
|
|
164
165
|
}
|
|
165
|
-
} : {
|
|
166
|
+
} : {
|
|
167
|
+
rules: {
|
|
168
|
+
"import/enforce-node-protocol-usage": "off"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
166
171
|
typescript ? {
|
|
167
172
|
extends: [
|
|
168
173
|
pluginImport.flatConfigs.typescript,
|
|
@@ -240,6 +245,7 @@ var jsStrict = mergeRules(
|
|
|
240
245
|
"no-promise-executor-return": "error",
|
|
241
246
|
"no-self-compare": "error",
|
|
242
247
|
"no-template-curly-in-string": "error",
|
|
248
|
+
"no-unassigned-vars": "error",
|
|
243
249
|
"no-unmodified-loop-condition": "error",
|
|
244
250
|
"no-unreachable-loop": "error",
|
|
245
251
|
"no-use-before-define": "error",
|
|
@@ -898,6 +904,7 @@ var _eslintplugin = require('@vitest/eslint-plugin'); var _eslintplugin2 = _inte
|
|
|
898
904
|
var vitestStrict = mergeRules(_eslintplugin2.default.configs.recommended, {
|
|
899
905
|
"vitest/consistent-test-filename": "off",
|
|
900
906
|
"vitest/consistent-test-it": "error",
|
|
907
|
+
"vitest/consistent-vitest-vi": "error",
|
|
901
908
|
"vitest/max-expects": "off",
|
|
902
909
|
"vitest/max-nested-describe": "off",
|
|
903
910
|
"vitest/no-alias-methods": "error",
|
|
@@ -910,6 +917,8 @@ var vitestStrict = mergeRules(_eslintplugin2.default.configs.recommended, {
|
|
|
910
917
|
"vitest/no-duplicate-hooks": "error",
|
|
911
918
|
"vitest/no-focused-tests": "off",
|
|
912
919
|
"vitest/no-hooks": "off",
|
|
920
|
+
"vitest/no-importing-vitest-globals": "off",
|
|
921
|
+
// conflict with vitest/prefer-importing-vitest-globals
|
|
913
922
|
"vitest/no-interpolation-in-snapshots": "error",
|
|
914
923
|
"vitest/no-large-snapshots": "off",
|
|
915
924
|
"vitest/no-mocks-import": "off",
|
|
@@ -926,8 +935,12 @@ var vitestStrict = mergeRules(_eslintplugin2.default.configs.recommended, {
|
|
|
926
935
|
"vitest/padding-around-describe-blocks": "error",
|
|
927
936
|
"vitest/padding-around-expect-groups": "error",
|
|
928
937
|
"vitest/padding-around-test-blocks": "error",
|
|
938
|
+
"vitest/prefer-called-once": "warn",
|
|
939
|
+
"vitest/prefer-called-times": "off",
|
|
940
|
+
// conflict with vitest/prefer-called-once
|
|
929
941
|
"vitest/prefer-called-with": "error",
|
|
930
942
|
"vitest/prefer-comparison-matcher": "error",
|
|
943
|
+
"vitest/prefer-describe-function-title": "error",
|
|
931
944
|
"vitest/prefer-each": "error",
|
|
932
945
|
"vitest/prefer-equality-matcher": "error",
|
|
933
946
|
"vitest/prefer-expect-assertions": "off",
|
|
@@ -935,6 +948,7 @@ var vitestStrict = mergeRules(_eslintplugin2.default.configs.recommended, {
|
|
|
935
948
|
"vitest/prefer-expect-resolves": "error",
|
|
936
949
|
"vitest/prefer-hooks-in-order": "error",
|
|
937
950
|
"vitest/prefer-hooks-on-top": "error",
|
|
951
|
+
"vitest/prefer-importing-vitest-globals": "warn",
|
|
938
952
|
"vitest/prefer-lowercase-title": "error",
|
|
939
953
|
"vitest/prefer-mock-promise-shorthand": "error",
|
|
940
954
|
"vitest/prefer-snapshot-hint": "error",
|
|
@@ -954,7 +968,8 @@ var vitestStrict = mergeRules(_eslintplugin2.default.configs.recommended, {
|
|
|
954
968
|
"vitest/require-mock-type-parameters": "off",
|
|
955
969
|
"vitest/require-to-throw-message": "error",
|
|
956
970
|
"vitest/require-top-level-describe": "error",
|
|
957
|
-
"vitest/valid-expect-in-promise": "error"
|
|
971
|
+
"vitest/valid-expect-in-promise": "error",
|
|
972
|
+
"vitest/warn-todo": "off"
|
|
958
973
|
});
|
|
959
974
|
function vitest(config) {
|
|
960
975
|
return _typescripteslint2.default.config({
|
|
@@ -967,9 +982,9 @@ function vitest(config) {
|
|
|
967
982
|
var _eslintpluginunicorn = require('eslint-plugin-unicorn'); var _eslintpluginunicorn2 = _interopRequireDefault(_eslintpluginunicorn);
|
|
968
983
|
var unicornRecommended = mergeRules(
|
|
969
984
|
{
|
|
970
|
-
..._eslintpluginunicorn2.default.configs
|
|
985
|
+
..._eslintpluginunicorn2.default.configs.recommended,
|
|
971
986
|
rules: Object.fromEntries(
|
|
972
|
-
Object.entries(_nullishCoalesce(_eslintpluginunicorn2.default.configs
|
|
987
|
+
Object.entries(_nullishCoalesce(_eslintpluginunicorn2.default.configs.recommended.rules, () => ( {}))).filter(
|
|
973
988
|
([_key, value]) => value !== "off"
|
|
974
989
|
)
|
|
975
990
|
)
|
|
@@ -1017,10 +1032,14 @@ var unicornRecommended = mergeRules(
|
|
|
1017
1032
|
// disabled style rules
|
|
1018
1033
|
"unicorn/prefer-global-this": "off",
|
|
1019
1034
|
// discarded
|
|
1035
|
+
"unicorn/prefer-import-meta-properties": "off",
|
|
1036
|
+
// not recommended
|
|
1020
1037
|
"unicorn/prefer-json-parse-buffer": "off",
|
|
1021
1038
|
// not recommended
|
|
1022
1039
|
"unicorn/prefer-keyboard-event-key": "off",
|
|
1023
1040
|
// allow keyCode
|
|
1041
|
+
"unicorn/prefer-node-protocol": "off",
|
|
1042
|
+
// disabled for use import/enforce-node-protocol-usage
|
|
1024
1043
|
"unicorn/prefer-string-raw": "off",
|
|
1025
1044
|
// disallow String.raw
|
|
1026
1045
|
"unicorn/prefer-structured-clone": "off",
|
package/dist/index.mjs
CHANGED
|
@@ -71,6 +71,7 @@ var importsStrict = mergeRules(
|
|
|
71
71
|
},
|
|
72
72
|
// https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#static-analysis
|
|
73
73
|
{
|
|
74
|
+
"import/enforce-node-protocol-usage": "error",
|
|
74
75
|
"import/no-absolute-path": "error",
|
|
75
76
|
"import/no-cycle": "error",
|
|
76
77
|
"import/no-dynamic-require": "error",
|
|
@@ -162,7 +163,11 @@ function imports({
|
|
|
162
163
|
rules: {
|
|
163
164
|
"import/no-nodejs-modules": "off"
|
|
164
165
|
}
|
|
165
|
-
} : {
|
|
166
|
+
} : {
|
|
167
|
+
rules: {
|
|
168
|
+
"import/enforce-node-protocol-usage": "off"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
166
171
|
typescript ? {
|
|
167
172
|
extends: [
|
|
168
173
|
pluginImport.flatConfigs.typescript,
|
|
@@ -240,6 +245,7 @@ var jsStrict = mergeRules(
|
|
|
240
245
|
"no-promise-executor-return": "error",
|
|
241
246
|
"no-self-compare": "error",
|
|
242
247
|
"no-template-curly-in-string": "error",
|
|
248
|
+
"no-unassigned-vars": "error",
|
|
243
249
|
"no-unmodified-loop-condition": "error",
|
|
244
250
|
"no-unreachable-loop": "error",
|
|
245
251
|
"no-use-before-define": "error",
|
|
@@ -898,6 +904,7 @@ import pluginTs5 from "typescript-eslint";
|
|
|
898
904
|
var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
|
|
899
905
|
"vitest/consistent-test-filename": "off",
|
|
900
906
|
"vitest/consistent-test-it": "error",
|
|
907
|
+
"vitest/consistent-vitest-vi": "error",
|
|
901
908
|
"vitest/max-expects": "off",
|
|
902
909
|
"vitest/max-nested-describe": "off",
|
|
903
910
|
"vitest/no-alias-methods": "error",
|
|
@@ -910,6 +917,8 @@ var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
|
|
|
910
917
|
"vitest/no-duplicate-hooks": "error",
|
|
911
918
|
"vitest/no-focused-tests": "off",
|
|
912
919
|
"vitest/no-hooks": "off",
|
|
920
|
+
"vitest/no-importing-vitest-globals": "off",
|
|
921
|
+
// conflict with vitest/prefer-importing-vitest-globals
|
|
913
922
|
"vitest/no-interpolation-in-snapshots": "error",
|
|
914
923
|
"vitest/no-large-snapshots": "off",
|
|
915
924
|
"vitest/no-mocks-import": "off",
|
|
@@ -926,8 +935,12 @@ var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
|
|
|
926
935
|
"vitest/padding-around-describe-blocks": "error",
|
|
927
936
|
"vitest/padding-around-expect-groups": "error",
|
|
928
937
|
"vitest/padding-around-test-blocks": "error",
|
|
938
|
+
"vitest/prefer-called-once": "warn",
|
|
939
|
+
"vitest/prefer-called-times": "off",
|
|
940
|
+
// conflict with vitest/prefer-called-once
|
|
929
941
|
"vitest/prefer-called-with": "error",
|
|
930
942
|
"vitest/prefer-comparison-matcher": "error",
|
|
943
|
+
"vitest/prefer-describe-function-title": "error",
|
|
931
944
|
"vitest/prefer-each": "error",
|
|
932
945
|
"vitest/prefer-equality-matcher": "error",
|
|
933
946
|
"vitest/prefer-expect-assertions": "off",
|
|
@@ -935,6 +948,7 @@ var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
|
|
|
935
948
|
"vitest/prefer-expect-resolves": "error",
|
|
936
949
|
"vitest/prefer-hooks-in-order": "error",
|
|
937
950
|
"vitest/prefer-hooks-on-top": "error",
|
|
951
|
+
"vitest/prefer-importing-vitest-globals": "warn",
|
|
938
952
|
"vitest/prefer-lowercase-title": "error",
|
|
939
953
|
"vitest/prefer-mock-promise-shorthand": "error",
|
|
940
954
|
"vitest/prefer-snapshot-hint": "error",
|
|
@@ -954,7 +968,8 @@ var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
|
|
|
954
968
|
"vitest/require-mock-type-parameters": "off",
|
|
955
969
|
"vitest/require-to-throw-message": "error",
|
|
956
970
|
"vitest/require-top-level-describe": "error",
|
|
957
|
-
"vitest/valid-expect-in-promise": "error"
|
|
971
|
+
"vitest/valid-expect-in-promise": "error",
|
|
972
|
+
"vitest/warn-todo": "off"
|
|
958
973
|
});
|
|
959
974
|
function vitest(config) {
|
|
960
975
|
return pluginTs5.config({
|
|
@@ -967,9 +982,9 @@ function vitest(config) {
|
|
|
967
982
|
import pluginUnicorn from "eslint-plugin-unicorn";
|
|
968
983
|
var unicornRecommended = mergeRules(
|
|
969
984
|
{
|
|
970
|
-
...pluginUnicorn.configs
|
|
985
|
+
...pluginUnicorn.configs.recommended,
|
|
971
986
|
rules: Object.fromEntries(
|
|
972
|
-
Object.entries(pluginUnicorn.configs
|
|
987
|
+
Object.entries(pluginUnicorn.configs.recommended.rules ?? {}).filter(
|
|
973
988
|
([_key, value]) => value !== "off"
|
|
974
989
|
)
|
|
975
990
|
)
|
|
@@ -1017,10 +1032,14 @@ var unicornRecommended = mergeRules(
|
|
|
1017
1032
|
// disabled style rules
|
|
1018
1033
|
"unicorn/prefer-global-this": "off",
|
|
1019
1034
|
// discarded
|
|
1035
|
+
"unicorn/prefer-import-meta-properties": "off",
|
|
1036
|
+
// not recommended
|
|
1020
1037
|
"unicorn/prefer-json-parse-buffer": "off",
|
|
1021
1038
|
// not recommended
|
|
1022
1039
|
"unicorn/prefer-keyboard-event-key": "off",
|
|
1023
1040
|
// allow keyCode
|
|
1041
|
+
"unicorn/prefer-node-protocol": "off",
|
|
1042
|
+
// disabled for use import/enforce-node-protocol-usage
|
|
1024
1043
|
"unicorn/prefer-string-raw": "off",
|
|
1025
1044
|
// disallow String.raw
|
|
1026
1045
|
"unicorn/prefer-structured-clone": "off",
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ofk/eslint-config",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ofk (https://github.com/ofk/)",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/ofk/eslint-config.git"
|
|
10
|
+
},
|
|
7
11
|
"exports": {
|
|
8
12
|
".": {
|
|
9
13
|
"import": {
|
|
@@ -22,26 +26,28 @@
|
|
|
22
26
|
"scripts": {
|
|
23
27
|
"build": "tsup",
|
|
24
28
|
"prelint": "npm run build",
|
|
25
|
-
"lint": "run-
|
|
29
|
+
"lint": "run-p lint:**",
|
|
26
30
|
"lint:eslint": "eslint --config eslint.config.mjs .",
|
|
27
31
|
"lint:eslint-cjs": "eslint --config eslint.config.cjs .",
|
|
28
32
|
"lint:prettier": "prettier --check .",
|
|
29
33
|
"lint:prettier-package-json": "prettier-package-json --list-different",
|
|
34
|
+
"lint:tsc": "tsc",
|
|
30
35
|
"prelint-fix": "npm run build",
|
|
31
|
-
"lint-fix": "run-s lint-fix
|
|
36
|
+
"lint-fix": "run-s lint-fix:**",
|
|
32
37
|
"lint-fix:eslint": "eslint --config eslint.config.mjs --fix .",
|
|
33
38
|
"lint-fix:prettier": "prettier --write .",
|
|
34
39
|
"lint-fix:prettier-package-json": "prettier-package-json --write",
|
|
40
|
+
"lint-fix:tsc": "run-s lint:tsc",
|
|
35
41
|
"prepare": "husky",
|
|
36
42
|
"prepublishOnly": "npm run build",
|
|
37
|
-
"test": "run-s lint test
|
|
43
|
+
"test": "run-s lint test:**",
|
|
38
44
|
"test:vitest": "vitest run"
|
|
39
45
|
},
|
|
40
46
|
"sideEffects": false,
|
|
41
47
|
"peerDependencies": {
|
|
42
48
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
43
49
|
"@eslint/js": "^9.18.0",
|
|
44
|
-
"@vitest/eslint-plugin": "^1.
|
|
50
|
+
"@vitest/eslint-plugin": "^1.1.41",
|
|
45
51
|
"confusing-browser-globals": "^1.0.1",
|
|
46
52
|
"eslint-plugin-import": "^2.31.0",
|
|
47
53
|
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
@@ -102,33 +108,33 @@
|
|
|
102
108
|
"@rollup/rollup-linux-x64-gnu": "*"
|
|
103
109
|
},
|
|
104
110
|
"devDependencies": {
|
|
105
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
106
|
-
"@eslint/js": "^9.
|
|
111
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
112
|
+
"@eslint/js": "^9.30.1",
|
|
107
113
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
108
114
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
109
115
|
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
110
|
-
"@vitest/eslint-plugin": "^1.
|
|
116
|
+
"@vitest/eslint-plugin": "^1.3.4",
|
|
111
117
|
"confusing-browser-globals": "^1.0.11",
|
|
112
|
-
"eslint": "^9.
|
|
113
|
-
"eslint-config-prettier": "^10.1.
|
|
114
|
-
"eslint-plugin-import": "^2.
|
|
118
|
+
"eslint": "^9.30.1",
|
|
119
|
+
"eslint-config-prettier": "^10.1.5",
|
|
120
|
+
"eslint-plugin-import": "^2.32.0",
|
|
115
121
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
116
|
-
"eslint-plugin-perfectionist": "^4.
|
|
117
|
-
"eslint-plugin-react": "^7.37.
|
|
122
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
123
|
+
"eslint-plugin-react": "^7.37.5",
|
|
118
124
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
119
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
120
|
-
"eslint-plugin-unicorn": "^
|
|
125
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
126
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
121
127
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
122
|
-
"globals": "^16.
|
|
128
|
+
"globals": "^16.3.0",
|
|
123
129
|
"husky": "^9.1.7",
|
|
124
|
-
"lint-staged": "^
|
|
130
|
+
"lint-staged": "^16.1.2",
|
|
125
131
|
"npm-run-all": "^4.1.5",
|
|
126
|
-
"prettier": "^3.
|
|
132
|
+
"prettier": "^3.6.2",
|
|
127
133
|
"prettier-package-json": "^2.8.0",
|
|
128
|
-
"tsup": "^8.
|
|
129
|
-
"typescript": "^5.8.
|
|
130
|
-
"typescript-eslint": "^8.
|
|
131
|
-
"vitest": "^3.
|
|
134
|
+
"tsup": "^8.5.0",
|
|
135
|
+
"typescript": "^5.8.3",
|
|
136
|
+
"typescript-eslint": "^8.36.0",
|
|
137
|
+
"vitest": "^3.2.4"
|
|
132
138
|
},
|
|
133
139
|
"keywords": [],
|
|
134
140
|
"lint-staged": {
|
|
@@ -142,5 +148,5 @@
|
|
|
142
148
|
"eslint --fix"
|
|
143
149
|
]
|
|
144
150
|
},
|
|
145
|
-
"packageManager": "npm@10.
|
|
151
|
+
"packageManager": "npm@10.9.2+sha512.8ab88f10f224a0c614cb717a7f7c30499014f77134120e9c1f0211ea3cf3397592cbe483feb38e0c4b3be1c54e347292c76a1b5edb94a3289d5448484ab8ac81"
|
|
146
152
|
}
|