@ofk/eslint-config 0.2.7 → 0.4.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.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +29 -20
- package/dist/index.mjs +38 -29
- package/package.json +21 -20
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { ConfigWithExtends } from '
|
|
1
|
+
import * as eslint_config from 'eslint/config';
|
|
2
|
+
import { ConfigWithExtends } from '@eslint/config-helpers';
|
|
3
3
|
import { Linter } from 'eslint';
|
|
4
4
|
|
|
5
5
|
declare function imports({ defaultExportFiles, node, typescript, ...config }: Pick<ConfigWithExtends, 'extends' | 'rules'> & {
|
|
6
6
|
defaultExportFiles?: false | string[];
|
|
7
7
|
node?: boolean;
|
|
8
8
|
typescript?: boolean;
|
|
9
|
-
}):
|
|
9
|
+
}): eslint_config.Config[];
|
|
10
10
|
|
|
11
11
|
declare function jsGlobals({ browser, es2021, es2022, es2023, es2024, es2025, node, }: {
|
|
12
12
|
browser?: boolean;
|
|
@@ -16,20 +16,20 @@ declare function jsGlobals({ browser, es2021, es2022, es2023, es2024, es2025, no
|
|
|
16
16
|
es2024?: boolean;
|
|
17
17
|
es2025?: boolean;
|
|
18
18
|
node?: boolean;
|
|
19
|
-
}):
|
|
19
|
+
}): eslint_config.Config[];
|
|
20
20
|
declare function js({ globals, ...config }: Pick<ConfigWithExtends, 'extends' | 'rules'> & {
|
|
21
21
|
globals?: false | Parameters<typeof jsGlobals>[0];
|
|
22
|
-
}):
|
|
22
|
+
}): eslint_config.Config[];
|
|
23
23
|
|
|
24
|
-
declare function react(config: Pick<ConfigWithExtends, 'extends' | 'rules'>):
|
|
24
|
+
declare function react(config: Pick<ConfigWithExtends, 'extends' | 'rules'>): eslint_config.Config[];
|
|
25
25
|
|
|
26
26
|
declare function ts({ disableTypeChecked, parserOptions, strict, ...config }: Pick<ConfigWithExtends, 'extends' | 'rules'> & {
|
|
27
27
|
disableTypeChecked?: boolean;
|
|
28
28
|
parserOptions?: false | Linter.ParserOptions;
|
|
29
29
|
strict?: boolean;
|
|
30
|
-
}):
|
|
30
|
+
}): eslint_config.Config[];
|
|
31
31
|
|
|
32
|
-
declare function vitest(config: Pick<ConfigWithExtends, 'extends' | 'rules'>):
|
|
32
|
+
declare function vitest(config: Pick<ConfigWithExtends, 'extends' | 'rules'>): eslint_config.Config[];
|
|
33
33
|
|
|
34
34
|
declare function defineBaseConfig({ eslintComments: eslintCommentsOptions, ignores, imports: importsOptions, js: jsOptions, perfectionist: perfectionistOptions, settings, ts: tsOptions, unicorn: unicornOptions, unusedImports: unusedImportsOptions, vitest: vitestOptions, ...config }?: Pick<ConfigWithExtends, 'extends' | 'ignores' | 'rules' | 'settings'> & {
|
|
35
35
|
eslintComments?: false | {};
|
|
@@ -40,17 +40,17 @@ declare function defineBaseConfig({ eslintComments: eslintCommentsOptions, ignor
|
|
|
40
40
|
unicorn?: false | {};
|
|
41
41
|
unusedImports?: false | {};
|
|
42
42
|
vitest?: false | Parameters<typeof vitest>[0];
|
|
43
|
-
}):
|
|
43
|
+
}): eslint_config.Config[];
|
|
44
44
|
|
|
45
45
|
declare function defineReactConfig({ jsxA11y: enabledJsxA11y, jsxRuntime: enabledJsxRuntime, reactHooks: enabledReactHooks, reactRefresh: enabledReactRefresh, ...reactOptions }?: Parameters<typeof react>[0] & {
|
|
46
46
|
jsxA11y?: boolean;
|
|
47
47
|
jsxRuntime?: boolean;
|
|
48
48
|
reactHooks?: boolean;
|
|
49
49
|
reactRefresh?: boolean;
|
|
50
|
-
}):
|
|
50
|
+
}): eslint_config.Config[];
|
|
51
51
|
|
|
52
52
|
declare function defineConfig({ eslintComments: eslintCommentsOptions, imports: importsOptions, js: jsOptions, perfectionist: perfectionistOptions, react: reactOptions, ts: tsOptions, unusedImports: unusedImportsOptions, vitest: vitestOptions, ...config }?: Parameters<typeof defineBaseConfig>[0] & {
|
|
53
53
|
react?: false | Parameters<typeof defineReactConfig>[0];
|
|
54
|
-
}):
|
|
54
|
+
}): eslint_config.Config[];
|
|
55
55
|
|
|
56
56
|
export { defineConfig as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { ConfigWithExtends } from '
|
|
1
|
+
import * as eslint_config from 'eslint/config';
|
|
2
|
+
import { ConfigWithExtends } from '@eslint/config-helpers';
|
|
3
3
|
import { Linter } from 'eslint';
|
|
4
4
|
|
|
5
5
|
declare function imports({ defaultExportFiles, node, typescript, ...config }: Pick<ConfigWithExtends, 'extends' | 'rules'> & {
|
|
6
6
|
defaultExportFiles?: false | string[];
|
|
7
7
|
node?: boolean;
|
|
8
8
|
typescript?: boolean;
|
|
9
|
-
}):
|
|
9
|
+
}): eslint_config.Config[];
|
|
10
10
|
|
|
11
11
|
declare function jsGlobals({ browser, es2021, es2022, es2023, es2024, es2025, node, }: {
|
|
12
12
|
browser?: boolean;
|
|
@@ -16,20 +16,20 @@ declare function jsGlobals({ browser, es2021, es2022, es2023, es2024, es2025, no
|
|
|
16
16
|
es2024?: boolean;
|
|
17
17
|
es2025?: boolean;
|
|
18
18
|
node?: boolean;
|
|
19
|
-
}):
|
|
19
|
+
}): eslint_config.Config[];
|
|
20
20
|
declare function js({ globals, ...config }: Pick<ConfigWithExtends, 'extends' | 'rules'> & {
|
|
21
21
|
globals?: false | Parameters<typeof jsGlobals>[0];
|
|
22
|
-
}):
|
|
22
|
+
}): eslint_config.Config[];
|
|
23
23
|
|
|
24
|
-
declare function react(config: Pick<ConfigWithExtends, 'extends' | 'rules'>):
|
|
24
|
+
declare function react(config: Pick<ConfigWithExtends, 'extends' | 'rules'>): eslint_config.Config[];
|
|
25
25
|
|
|
26
26
|
declare function ts({ disableTypeChecked, parserOptions, strict, ...config }: Pick<ConfigWithExtends, 'extends' | 'rules'> & {
|
|
27
27
|
disableTypeChecked?: boolean;
|
|
28
28
|
parserOptions?: false | Linter.ParserOptions;
|
|
29
29
|
strict?: boolean;
|
|
30
|
-
}):
|
|
30
|
+
}): eslint_config.Config[];
|
|
31
31
|
|
|
32
|
-
declare function vitest(config: Pick<ConfigWithExtends, 'extends' | 'rules'>):
|
|
32
|
+
declare function vitest(config: Pick<ConfigWithExtends, 'extends' | 'rules'>): eslint_config.Config[];
|
|
33
33
|
|
|
34
34
|
declare function defineBaseConfig({ eslintComments: eslintCommentsOptions, ignores, imports: importsOptions, js: jsOptions, perfectionist: perfectionistOptions, settings, ts: tsOptions, unicorn: unicornOptions, unusedImports: unusedImportsOptions, vitest: vitestOptions, ...config }?: Pick<ConfigWithExtends, 'extends' | 'ignores' | 'rules' | 'settings'> & {
|
|
35
35
|
eslintComments?: false | {};
|
|
@@ -40,17 +40,17 @@ declare function defineBaseConfig({ eslintComments: eslintCommentsOptions, ignor
|
|
|
40
40
|
unicorn?: false | {};
|
|
41
41
|
unusedImports?: false | {};
|
|
42
42
|
vitest?: false | Parameters<typeof vitest>[0];
|
|
43
|
-
}):
|
|
43
|
+
}): eslint_config.Config[];
|
|
44
44
|
|
|
45
45
|
declare function defineReactConfig({ jsxA11y: enabledJsxA11y, jsxRuntime: enabledJsxRuntime, reactHooks: enabledReactHooks, reactRefresh: enabledReactRefresh, ...reactOptions }?: Parameters<typeof react>[0] & {
|
|
46
46
|
jsxA11y?: boolean;
|
|
47
47
|
jsxRuntime?: boolean;
|
|
48
48
|
reactHooks?: boolean;
|
|
49
49
|
reactRefresh?: boolean;
|
|
50
|
-
}):
|
|
50
|
+
}): eslint_config.Config[];
|
|
51
51
|
|
|
52
52
|
declare function defineConfig({ eslintComments: eslintCommentsOptions, imports: importsOptions, js: jsOptions, perfectionist: perfectionistOptions, react: reactOptions, ts: tsOptions, unusedImports: unusedImportsOptions, vitest: vitestOptions, ...config }?: Parameters<typeof defineBaseConfig>[0] & {
|
|
53
53
|
react?: false | Parameters<typeof defineReactConfig>[0];
|
|
54
|
-
}):
|
|
54
|
+
}): eslint_config.Config[];
|
|
55
55
|
|
|
56
56
|
export = defineConfig;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/base.ts
|
|
2
|
-
var
|
|
2
|
+
var _config = require('eslint/config');
|
|
3
3
|
|
|
4
4
|
// src/configs/eslint-comments.ts
|
|
5
5
|
var _configs = require('@eslint-community/eslint-plugin-eslint-comments/configs'); var _configs2 = _interopRequireDefault(_configs);
|
|
@@ -142,7 +142,7 @@ function imports({
|
|
|
142
142
|
typescript = false,
|
|
143
143
|
...config
|
|
144
144
|
}) {
|
|
145
|
-
return
|
|
145
|
+
return _config.defineConfig.call(void 0,
|
|
146
146
|
importsStrict,
|
|
147
147
|
config,
|
|
148
148
|
// allow default export in config files
|
|
@@ -208,8 +208,8 @@ function imports({
|
|
|
208
208
|
// src/configs/js.ts
|
|
209
209
|
var _js = require('@eslint/js'); var _js2 = _interopRequireDefault(_js);
|
|
210
210
|
var _confusingbrowserglobals = require('confusing-browser-globals'); var _confusingbrowserglobals2 = _interopRequireDefault(_confusingbrowserglobals);
|
|
211
|
-
var _globals = require('globals'); var _globals2 = _interopRequireDefault(_globals);
|
|
212
211
|
|
|
212
|
+
var _globals = require('globals'); var _globals2 = _interopRequireDefault(_globals);
|
|
213
213
|
var jsStrict = mergeRules(
|
|
214
214
|
_js2.default.configs.recommended,
|
|
215
215
|
{
|
|
@@ -447,7 +447,7 @@ function jsGlobals({
|
|
|
447
447
|
es2025 = true,
|
|
448
448
|
node = true
|
|
449
449
|
}) {
|
|
450
|
-
return
|
|
450
|
+
return _config.defineConfig.call(void 0, {
|
|
451
451
|
languageOptions: {
|
|
452
452
|
globals: {
|
|
453
453
|
...es2021 ? _globals2.default.es2021 : {},
|
|
@@ -465,7 +465,7 @@ function js({
|
|
|
465
465
|
globals = {},
|
|
466
466
|
...config
|
|
467
467
|
}) {
|
|
468
|
-
return
|
|
468
|
+
return _config.defineConfig.call(void 0, globals ? jsGlobals(globals) : {}, jsStrict, config);
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
// src/configs/jsx-a11y.ts
|
|
@@ -501,11 +501,10 @@ var perfectionistStrict = mergeRules(
|
|
|
501
501
|
groups: [
|
|
502
502
|
"type",
|
|
503
503
|
["builtin", "external"],
|
|
504
|
-
"internal
|
|
504
|
+
"type-internal",
|
|
505
505
|
"internal",
|
|
506
|
-
["parent
|
|
506
|
+
["type-parent", "type-sibling", "type-index"],
|
|
507
507
|
["parent", "sibling", "index"],
|
|
508
|
-
"object",
|
|
509
508
|
"side-effect",
|
|
510
509
|
"side-effect-style",
|
|
511
510
|
"unknown"
|
|
@@ -520,9 +519,12 @@ var perfectionistStrict = mergeRules(
|
|
|
520
519
|
"perfectionist/sort-jsx-props": mergeRuleOptions(
|
|
521
520
|
perfectionistRecommended.rules["perfectionist/sort-jsx-props"],
|
|
522
521
|
{
|
|
523
|
-
customGroups:
|
|
524
|
-
|
|
525
|
-
|
|
522
|
+
customGroups: [
|
|
523
|
+
{
|
|
524
|
+
elementNamePattern: "^(?:key|ref)$",
|
|
525
|
+
groupName: "reserved"
|
|
526
|
+
}
|
|
527
|
+
],
|
|
526
528
|
groups: ["reserved", "unknown"]
|
|
527
529
|
}
|
|
528
530
|
),
|
|
@@ -691,7 +693,7 @@ var reactStrict = mergeRules(_nullishCoalesce(_eslintpluginreact2.default.config
|
|
|
691
693
|
"react/void-dom-elements-no-children": "error"
|
|
692
694
|
});
|
|
693
695
|
function react(config) {
|
|
694
|
-
return
|
|
696
|
+
return _config.defineConfig.call(void 0,
|
|
695
697
|
{
|
|
696
698
|
settings: {
|
|
697
699
|
react: {
|
|
@@ -717,6 +719,7 @@ var reactRefreshStrict = mergeRules(_eslintpluginreactrefresh2.default.configs.v
|
|
|
717
719
|
|
|
718
720
|
// src/configs/ts.ts
|
|
719
721
|
|
|
722
|
+
var _typescripteslint = require('typescript-eslint'); var _typescripteslint2 = _interopRequireDefault(_typescripteslint);
|
|
720
723
|
var jsStrictRules = _nullishCoalesce(jsStrict.rules, () => ( {}));
|
|
721
724
|
var tsEslintOverrideRules = mergeRules(
|
|
722
725
|
{},
|
|
@@ -757,6 +760,7 @@ var tsEslintOverrideRules = mergeRules(
|
|
|
757
760
|
"@typescript-eslint/no-redeclare": jsStrictRules["no-redeclare"],
|
|
758
761
|
"@typescript-eslint/no-restricted-imports": jsStrictRules["no-restricted-imports"],
|
|
759
762
|
"@typescript-eslint/no-shadow": jsStrictRules["no-shadow"],
|
|
763
|
+
"@typescript-eslint/no-unused-private-class-members": jsStrictRules["no-unused-private-class-members"],
|
|
760
764
|
"@typescript-eslint/no-use-before-define": jsStrictRules["no-use-before-define"],
|
|
761
765
|
"@typescript-eslint/prefer-destructuring": jsStrictRules["prefer-destructuring"],
|
|
762
766
|
"class-methods-use-this": "off",
|
|
@@ -796,12 +800,12 @@ var tsRecommendedOverride = mergeRules(
|
|
|
796
800
|
// confilict with @typescript-eslint/consistent-type-imports
|
|
797
801
|
}
|
|
798
802
|
);
|
|
799
|
-
var tsRecommended =
|
|
803
|
+
var tsRecommended = _config.defineConfig.call(void 0,
|
|
800
804
|
_typescripteslint2.default.configs.recommended,
|
|
801
805
|
tsEslintOverrideRules,
|
|
802
806
|
tsRecommendedOverride
|
|
803
807
|
);
|
|
804
|
-
var tsStrict =
|
|
808
|
+
var tsStrict = _config.defineConfig.call(void 0,
|
|
805
809
|
_typescripteslint2.default.configs.strictTypeChecked,
|
|
806
810
|
_typescripteslint2.default.configs.stylisticTypeChecked,
|
|
807
811
|
tsEslintOverrideRules,
|
|
@@ -860,7 +864,7 @@ function ts({
|
|
|
860
864
|
strict = true,
|
|
861
865
|
...config
|
|
862
866
|
}) {
|
|
863
|
-
return
|
|
867
|
+
return _config.defineConfig.call(void 0,
|
|
864
868
|
parserOptions ? {
|
|
865
869
|
languageOptions: {
|
|
866
870
|
parserOptions: {
|
|
@@ -899,6 +903,7 @@ var _eslintplugin = require('@vitest/eslint-plugin'); var _eslintplugin2 = _inte
|
|
|
899
903
|
var vitestStrict = mergeRules(
|
|
900
904
|
_eslintplugin2.default.configs.recommended,
|
|
901
905
|
{
|
|
906
|
+
"vitest/consistent-each-for": "off",
|
|
902
907
|
"vitest/consistent-test-filename": "off",
|
|
903
908
|
"vitest/consistent-test-it": "error",
|
|
904
909
|
"vitest/consistent-vitest-vi": "error",
|
|
@@ -952,6 +957,7 @@ var vitestStrict = mergeRules(
|
|
|
952
957
|
"vitest/prefer-importing-vitest-globals": "warn",
|
|
953
958
|
"vitest/prefer-lowercase-title": "error",
|
|
954
959
|
"vitest/prefer-mock-promise-shorthand": "error",
|
|
960
|
+
"vitest/prefer-mock-return-shorthand": "error",
|
|
955
961
|
"vitest/prefer-snapshot-hint": "error",
|
|
956
962
|
"vitest/prefer-spy-on": "error",
|
|
957
963
|
"vitest/prefer-strict-boolean-matchers": "off",
|
|
@@ -962,11 +968,14 @@ var vitestStrict = mergeRules(
|
|
|
962
968
|
"vitest/prefer-to-be-object": "error",
|
|
963
969
|
"vitest/prefer-to-be-truthy": "error",
|
|
964
970
|
"vitest/prefer-to-contain": "error",
|
|
971
|
+
"vitest/prefer-to-have-been-called-times": "error",
|
|
965
972
|
"vitest/prefer-to-have-length": "error",
|
|
966
973
|
"vitest/prefer-todo": "error",
|
|
967
974
|
"vitest/prefer-vi-mocked": "error",
|
|
975
|
+
"vitest/require-awaited-expect-poll": "error",
|
|
968
976
|
"vitest/require-hook": "error",
|
|
969
977
|
"vitest/require-mock-type-parameters": "off",
|
|
978
|
+
"vitest/require-test-timeout": "off",
|
|
970
979
|
"vitest/require-to-throw-message": "error",
|
|
971
980
|
"vitest/require-top-level-describe": "error",
|
|
972
981
|
"vitest/valid-expect-in-promise": "error",
|
|
@@ -974,7 +983,7 @@ var vitestStrict = mergeRules(
|
|
|
974
983
|
}
|
|
975
984
|
);
|
|
976
985
|
function vitest(config) {
|
|
977
|
-
return
|
|
986
|
+
return _config.defineConfig.call(void 0, {
|
|
978
987
|
extends: [vitestStrict, config],
|
|
979
988
|
files: ["tests/**", "*.test.*"]
|
|
980
989
|
});
|
|
@@ -1079,7 +1088,7 @@ function defineBaseConfig({
|
|
|
1079
1088
|
vitest: vitestOptions = {},
|
|
1080
1089
|
...config
|
|
1081
1090
|
} = {}) {
|
|
1082
|
-
return
|
|
1091
|
+
return _config.defineConfig.call(void 0,
|
|
1083
1092
|
settings ? { settings } : {},
|
|
1084
1093
|
ignores ? { ignores } : {},
|
|
1085
1094
|
jsOptions ? js(jsOptions) : {},
|
|
@@ -1104,7 +1113,7 @@ function defineReactConfig({
|
|
|
1104
1113
|
reactRefresh: enabledReactRefresh = true,
|
|
1105
1114
|
...reactOptions
|
|
1106
1115
|
} = {}) {
|
|
1107
|
-
return
|
|
1116
|
+
return _config.defineConfig.call(void 0,
|
|
1108
1117
|
react({
|
|
1109
1118
|
...reactOptions,
|
|
1110
1119
|
extends: [
|
|
@@ -1119,7 +1128,7 @@ function defineReactConfig({
|
|
|
1119
1128
|
}
|
|
1120
1129
|
|
|
1121
1130
|
// src/index.ts
|
|
1122
|
-
function
|
|
1131
|
+
function defineConfig8({
|
|
1123
1132
|
eslintComments: eslintCommentsOptions,
|
|
1124
1133
|
imports: importsOptions,
|
|
1125
1134
|
js: jsOptions,
|
|
@@ -1144,6 +1153,6 @@ function defineConfig({
|
|
|
1144
1153
|
}
|
|
1145
1154
|
|
|
1146
1155
|
|
|
1147
|
-
exports.default =
|
|
1156
|
+
exports.default = defineConfig8;
|
|
1148
1157
|
|
|
1149
1158
|
module.exports = exports.default;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/base.ts
|
|
2
|
-
import
|
|
2
|
+
import { defineConfig as defineConfig6 } from "eslint/config";
|
|
3
3
|
|
|
4
4
|
// src/configs/eslint-comments.ts
|
|
5
5
|
import pluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments/configs";
|
|
@@ -28,7 +28,7 @@ var eslintCommentsStrict = mergeRules(pluginEslintComments.recommended, {
|
|
|
28
28
|
|
|
29
29
|
// src/configs/imports.ts
|
|
30
30
|
import * as pluginImport from "eslint-plugin-import";
|
|
31
|
-
import
|
|
31
|
+
import { defineConfig } from "eslint/config";
|
|
32
32
|
var importsStrict = mergeRules(
|
|
33
33
|
pluginImport.flatConfigs.recommended,
|
|
34
34
|
// https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#helpful-warnings
|
|
@@ -142,7 +142,7 @@ function imports({
|
|
|
142
142
|
typescript = false,
|
|
143
143
|
...config
|
|
144
144
|
}) {
|
|
145
|
-
return
|
|
145
|
+
return defineConfig(
|
|
146
146
|
importsStrict,
|
|
147
147
|
config,
|
|
148
148
|
// allow default export in config files
|
|
@@ -208,8 +208,8 @@ function imports({
|
|
|
208
208
|
// src/configs/js.ts
|
|
209
209
|
import pluginJs from "@eslint/js";
|
|
210
210
|
import confusingBrowserGlobals from "confusing-browser-globals";
|
|
211
|
+
import { defineConfig as defineConfig2 } from "eslint/config";
|
|
211
212
|
import globalVariables from "globals";
|
|
212
|
-
import pluginTs2 from "typescript-eslint";
|
|
213
213
|
var jsStrict = mergeRules(
|
|
214
214
|
pluginJs.configs.recommended,
|
|
215
215
|
{
|
|
@@ -447,7 +447,7 @@ function jsGlobals({
|
|
|
447
447
|
es2025 = true,
|
|
448
448
|
node = true
|
|
449
449
|
}) {
|
|
450
|
-
return
|
|
450
|
+
return defineConfig2({
|
|
451
451
|
languageOptions: {
|
|
452
452
|
globals: {
|
|
453
453
|
...es2021 ? globalVariables.es2021 : {},
|
|
@@ -465,7 +465,7 @@ function js({
|
|
|
465
465
|
globals = {},
|
|
466
466
|
...config
|
|
467
467
|
}) {
|
|
468
|
-
return
|
|
468
|
+
return defineConfig2(globals ? jsGlobals(globals) : {}, jsStrict, config);
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
// src/configs/jsx-a11y.ts
|
|
@@ -501,11 +501,10 @@ var perfectionistStrict = mergeRules(
|
|
|
501
501
|
groups: [
|
|
502
502
|
"type",
|
|
503
503
|
["builtin", "external"],
|
|
504
|
-
"internal
|
|
504
|
+
"type-internal",
|
|
505
505
|
"internal",
|
|
506
|
-
["parent
|
|
506
|
+
["type-parent", "type-sibling", "type-index"],
|
|
507
507
|
["parent", "sibling", "index"],
|
|
508
|
-
"object",
|
|
509
508
|
"side-effect",
|
|
510
509
|
"side-effect-style",
|
|
511
510
|
"unknown"
|
|
@@ -520,9 +519,12 @@ var perfectionistStrict = mergeRules(
|
|
|
520
519
|
"perfectionist/sort-jsx-props": mergeRuleOptions(
|
|
521
520
|
perfectionistRecommended.rules["perfectionist/sort-jsx-props"],
|
|
522
521
|
{
|
|
523
|
-
customGroups:
|
|
524
|
-
|
|
525
|
-
|
|
522
|
+
customGroups: [
|
|
523
|
+
{
|
|
524
|
+
elementNamePattern: "^(?:key|ref)$",
|
|
525
|
+
groupName: "reserved"
|
|
526
|
+
}
|
|
527
|
+
],
|
|
526
528
|
groups: ["reserved", "unknown"]
|
|
527
529
|
}
|
|
528
530
|
),
|
|
@@ -568,7 +570,7 @@ var perfectionistStrict = mergeRules(
|
|
|
568
570
|
|
|
569
571
|
// src/configs/react.ts
|
|
570
572
|
import pluginReact from "eslint-plugin-react";
|
|
571
|
-
import
|
|
573
|
+
import { defineConfig as defineConfig3 } from "eslint/config";
|
|
572
574
|
var reactStrict = mergeRules(pluginReact.configs.flat.recommended ?? {}, {
|
|
573
575
|
"react/boolean-prop-naming": "off",
|
|
574
576
|
"react/button-has-type": ["error", { button: true, reset: false, submit: true }],
|
|
@@ -691,7 +693,7 @@ var reactStrict = mergeRules(pluginReact.configs.flat.recommended ?? {}, {
|
|
|
691
693
|
"react/void-dom-elements-no-children": "error"
|
|
692
694
|
});
|
|
693
695
|
function react(config) {
|
|
694
|
-
return
|
|
696
|
+
return defineConfig3(
|
|
695
697
|
{
|
|
696
698
|
settings: {
|
|
697
699
|
react: {
|
|
@@ -716,7 +718,8 @@ import pluginReactRefresh from "eslint-plugin-react-refresh";
|
|
|
716
718
|
var reactRefreshStrict = mergeRules(pluginReactRefresh.configs.vite);
|
|
717
719
|
|
|
718
720
|
// src/configs/ts.ts
|
|
719
|
-
import
|
|
721
|
+
import { defineConfig as defineConfig4 } from "eslint/config";
|
|
722
|
+
import pluginTs from "typescript-eslint";
|
|
720
723
|
var jsStrictRules = jsStrict.rules ?? {};
|
|
721
724
|
var tsEslintOverrideRules = mergeRules(
|
|
722
725
|
{},
|
|
@@ -757,6 +760,7 @@ var tsEslintOverrideRules = mergeRules(
|
|
|
757
760
|
"@typescript-eslint/no-redeclare": jsStrictRules["no-redeclare"],
|
|
758
761
|
"@typescript-eslint/no-restricted-imports": jsStrictRules["no-restricted-imports"],
|
|
759
762
|
"@typescript-eslint/no-shadow": jsStrictRules["no-shadow"],
|
|
763
|
+
"@typescript-eslint/no-unused-private-class-members": jsStrictRules["no-unused-private-class-members"],
|
|
760
764
|
"@typescript-eslint/no-use-before-define": jsStrictRules["no-use-before-define"],
|
|
761
765
|
"@typescript-eslint/prefer-destructuring": jsStrictRules["prefer-destructuring"],
|
|
762
766
|
"class-methods-use-this": "off",
|
|
@@ -796,14 +800,14 @@ var tsRecommendedOverride = mergeRules(
|
|
|
796
800
|
// confilict with @typescript-eslint/consistent-type-imports
|
|
797
801
|
}
|
|
798
802
|
);
|
|
799
|
-
var tsRecommended =
|
|
800
|
-
|
|
803
|
+
var tsRecommended = defineConfig4(
|
|
804
|
+
pluginTs.configs.recommended,
|
|
801
805
|
tsEslintOverrideRules,
|
|
802
806
|
tsRecommendedOverride
|
|
803
807
|
);
|
|
804
|
-
var tsStrict =
|
|
805
|
-
|
|
806
|
-
|
|
808
|
+
var tsStrict = defineConfig4(
|
|
809
|
+
pluginTs.configs.strictTypeChecked,
|
|
810
|
+
pluginTs.configs.stylisticTypeChecked,
|
|
807
811
|
tsEslintOverrideRules,
|
|
808
812
|
tsRecommendedOverride,
|
|
809
813
|
{
|
|
@@ -860,7 +864,7 @@ function ts({
|
|
|
860
864
|
strict = true,
|
|
861
865
|
...config
|
|
862
866
|
}) {
|
|
863
|
-
return
|
|
867
|
+
return defineConfig4(
|
|
864
868
|
parserOptions ? {
|
|
865
869
|
languageOptions: {
|
|
866
870
|
parserOptions: {
|
|
@@ -872,7 +876,7 @@ function ts({
|
|
|
872
876
|
strict ? tsStrict : tsRecommended,
|
|
873
877
|
config,
|
|
874
878
|
disableTypeChecked ? {
|
|
875
|
-
extends: [
|
|
879
|
+
extends: [pluginTs.configs.disableTypeChecked],
|
|
876
880
|
files: ["**/*.{js,jsx,mjs,cjs}"]
|
|
877
881
|
} : {}
|
|
878
882
|
);
|
|
@@ -895,10 +899,11 @@ var unusedImportsStrict = mergeRules({
|
|
|
895
899
|
|
|
896
900
|
// src/configs/vitest.ts
|
|
897
901
|
import pluginVitest from "@vitest/eslint-plugin";
|
|
898
|
-
import
|
|
902
|
+
import { defineConfig as defineConfig5 } from "eslint/config";
|
|
899
903
|
var vitestStrict = mergeRules(
|
|
900
904
|
pluginVitest.configs.recommended,
|
|
901
905
|
{
|
|
906
|
+
"vitest/consistent-each-for": "off",
|
|
902
907
|
"vitest/consistent-test-filename": "off",
|
|
903
908
|
"vitest/consistent-test-it": "error",
|
|
904
909
|
"vitest/consistent-vitest-vi": "error",
|
|
@@ -952,6 +957,7 @@ var vitestStrict = mergeRules(
|
|
|
952
957
|
"vitest/prefer-importing-vitest-globals": "warn",
|
|
953
958
|
"vitest/prefer-lowercase-title": "error",
|
|
954
959
|
"vitest/prefer-mock-promise-shorthand": "error",
|
|
960
|
+
"vitest/prefer-mock-return-shorthand": "error",
|
|
955
961
|
"vitest/prefer-snapshot-hint": "error",
|
|
956
962
|
"vitest/prefer-spy-on": "error",
|
|
957
963
|
"vitest/prefer-strict-boolean-matchers": "off",
|
|
@@ -962,11 +968,14 @@ var vitestStrict = mergeRules(
|
|
|
962
968
|
"vitest/prefer-to-be-object": "error",
|
|
963
969
|
"vitest/prefer-to-be-truthy": "error",
|
|
964
970
|
"vitest/prefer-to-contain": "error",
|
|
971
|
+
"vitest/prefer-to-have-been-called-times": "error",
|
|
965
972
|
"vitest/prefer-to-have-length": "error",
|
|
966
973
|
"vitest/prefer-todo": "error",
|
|
967
974
|
"vitest/prefer-vi-mocked": "error",
|
|
975
|
+
"vitest/require-awaited-expect-poll": "error",
|
|
968
976
|
"vitest/require-hook": "error",
|
|
969
977
|
"vitest/require-mock-type-parameters": "off",
|
|
978
|
+
"vitest/require-test-timeout": "off",
|
|
970
979
|
"vitest/require-to-throw-message": "error",
|
|
971
980
|
"vitest/require-top-level-describe": "error",
|
|
972
981
|
"vitest/valid-expect-in-promise": "error",
|
|
@@ -974,7 +983,7 @@ var vitestStrict = mergeRules(
|
|
|
974
983
|
}
|
|
975
984
|
);
|
|
976
985
|
function vitest(config) {
|
|
977
|
-
return
|
|
986
|
+
return defineConfig5({
|
|
978
987
|
extends: [vitestStrict, config],
|
|
979
988
|
files: ["tests/**", "*.test.*"]
|
|
980
989
|
});
|
|
@@ -1079,7 +1088,7 @@ function defineBaseConfig({
|
|
|
1079
1088
|
vitest: vitestOptions = {},
|
|
1080
1089
|
...config
|
|
1081
1090
|
} = {}) {
|
|
1082
|
-
return
|
|
1091
|
+
return defineConfig6(
|
|
1083
1092
|
settings ? { settings } : {},
|
|
1084
1093
|
ignores ? { ignores } : {},
|
|
1085
1094
|
jsOptions ? js(jsOptions) : {},
|
|
@@ -1096,7 +1105,7 @@ function defineBaseConfig({
|
|
|
1096
1105
|
|
|
1097
1106
|
// src/react.ts
|
|
1098
1107
|
import pluginReact2 from "eslint-plugin-react";
|
|
1099
|
-
import
|
|
1108
|
+
import { defineConfig as defineConfig7 } from "eslint/config";
|
|
1100
1109
|
function defineReactConfig({
|
|
1101
1110
|
jsxA11y: enabledJsxA11y = true,
|
|
1102
1111
|
jsxRuntime: enabledJsxRuntime = true,
|
|
@@ -1104,7 +1113,7 @@ function defineReactConfig({
|
|
|
1104
1113
|
reactRefresh: enabledReactRefresh = true,
|
|
1105
1114
|
...reactOptions
|
|
1106
1115
|
} = {}) {
|
|
1107
|
-
return
|
|
1116
|
+
return defineConfig7(
|
|
1108
1117
|
react({
|
|
1109
1118
|
...reactOptions,
|
|
1110
1119
|
extends: [
|
|
@@ -1119,7 +1128,7 @@ function defineReactConfig({
|
|
|
1119
1128
|
}
|
|
1120
1129
|
|
|
1121
1130
|
// src/index.ts
|
|
1122
|
-
function
|
|
1131
|
+
function defineConfig8({
|
|
1123
1132
|
eslintComments: eslintCommentsOptions,
|
|
1124
1133
|
imports: importsOptions,
|
|
1125
1134
|
js: jsOptions,
|
|
@@ -1143,5 +1152,5 @@ function defineConfig({
|
|
|
1143
1152
|
});
|
|
1144
1153
|
}
|
|
1145
1154
|
export {
|
|
1146
|
-
|
|
1155
|
+
defineConfig8 as default
|
|
1147
1156
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ofk/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ofk (https://github.com/ofk/)",
|
|
@@ -47,18 +47,18 @@
|
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
49
49
|
"@eslint/js": "^9.27.0",
|
|
50
|
-
"@vitest/eslint-plugin": "^1.
|
|
50
|
+
"@vitest/eslint-plugin": "^1.6.9",
|
|
51
51
|
"confusing-browser-globals": "^1.0.1",
|
|
52
52
|
"eslint-plugin-import": "^2.32.0",
|
|
53
53
|
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
54
|
-
"eslint-plugin-perfectionist": "^
|
|
54
|
+
"eslint-plugin-perfectionist": "^5.6.0",
|
|
55
55
|
"eslint-plugin-react": "^7.35.0",
|
|
56
56
|
"eslint-plugin-react-hooks": "^7.0.0",
|
|
57
57
|
"eslint-plugin-react-refresh": "^0.4.16",
|
|
58
|
-
"eslint-plugin-unicorn": "^
|
|
58
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
59
59
|
"eslint-plugin-unused-imports": "^4.1.1",
|
|
60
60
|
"globals": ">=14.0.0",
|
|
61
|
-
"typescript-eslint": "^8.
|
|
61
|
+
"typescript-eslint": "^8.47.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependenciesMeta": {
|
|
64
64
|
"@eslint-community/eslint-plugin-eslint-comments": {
|
|
@@ -108,33 +108,34 @@
|
|
|
108
108
|
"@rollup/rollup-linux-x64-gnu": "*"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
112
|
-
"@eslint/
|
|
111
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.0",
|
|
112
|
+
"@eslint/config-helpers": "^0.5.2",
|
|
113
|
+
"@eslint/js": "^9.39.3",
|
|
113
114
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
114
115
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
115
116
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
116
|
-
"@vitest/eslint-plugin": "^1.
|
|
117
|
+
"@vitest/eslint-plugin": "^1.6.9",
|
|
117
118
|
"confusing-browser-globals": "^1.0.11",
|
|
118
|
-
"eslint": "^9.
|
|
119
|
+
"eslint": "^9.39.3",
|
|
119
120
|
"eslint-config-prettier": "^10.1.8",
|
|
120
121
|
"eslint-plugin-import": "^2.32.0",
|
|
121
122
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
122
|
-
"eslint-plugin-perfectionist": "^
|
|
123
|
+
"eslint-plugin-perfectionist": "^5.6.0",
|
|
123
124
|
"eslint-plugin-react": "^7.37.5",
|
|
124
|
-
"eslint-plugin-react-hooks": "^7.0.
|
|
125
|
-
"eslint-plugin-react-refresh": "^0.
|
|
126
|
-
"eslint-plugin-unicorn": "^
|
|
127
|
-
"eslint-plugin-unused-imports": "^4.
|
|
128
|
-
"globals": "^
|
|
125
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
126
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
127
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
128
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
129
|
+
"globals": "^17.4.0",
|
|
129
130
|
"husky": "^9.1.7",
|
|
130
|
-
"lint-staged": "^16.
|
|
131
|
+
"lint-staged": "^16.3.1",
|
|
131
132
|
"npm-run-all": "^4.1.5",
|
|
132
|
-
"prettier": "^3.
|
|
133
|
+
"prettier": "^3.8.1",
|
|
133
134
|
"prettier-package-json": "^2.8.0",
|
|
134
|
-
"tsup": "^8.5.
|
|
135
|
+
"tsup": "^8.5.1",
|
|
135
136
|
"typescript": "^5.9.3",
|
|
136
|
-
"typescript-eslint": "^8.
|
|
137
|
-
"vitest": "^
|
|
137
|
+
"typescript-eslint": "^8.56.1",
|
|
138
|
+
"vitest": "^4.0.18"
|
|
138
139
|
},
|
|
139
140
|
"keywords": [],
|
|
140
141
|
"lint-staged": {
|