@ofk/eslint-config 0.0.13 → 0.0.15
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/LICENSE +21 -0
- package/README.md +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +75 -105
- package/dist/index.mjs +7 -6
- package/package.json +20 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ofk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# @ofk/eslint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://npmjs.com/package/@ofk/eslint-config)
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
@ofk/eslint-config is an eslint config that enables **more rules than recommended**.
|
|
7
|
+
This is the base for [@ofk/eslint-config-recommend](https://npmjs.com/package/@ofk/eslint-config-recommend).
|
|
4
8
|
|
|
5
9
|
## Install
|
|
6
10
|
|
package/dist/index.d.ts
CHANGED
|
@@ -53,4 +53,4 @@ declare function defineConfig({ eslintComments: eslintCommentsOptions, imports:
|
|
|
53
53
|
react?: false | Parameters<typeof defineReactConfig>[0];
|
|
54
54
|
}): _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
|
|
55
55
|
|
|
56
|
-
export
|
|
56
|
+
export = defineConfig;
|
package/dist/index.js
CHANGED
|
@@ -1,44 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
default: () => defineConfig
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
|
|
37
|
-
// src/base.ts
|
|
38
|
-
var import_typescript_eslint6 = __toESM(require("typescript-eslint"));
|
|
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 _typescripteslint = require('typescript-eslint'); var _typescripteslint2 = _interopRequireDefault(_typescripteslint);
|
|
39
3
|
|
|
40
4
|
// src/configs/eslint-comments.ts
|
|
41
|
-
var
|
|
5
|
+
var _configs = require('@eslint-community/eslint-plugin-eslint-comments/configs'); var _configs2 = _interopRequireDefault(_configs);
|
|
42
6
|
|
|
43
7
|
// src/utils.ts
|
|
44
8
|
function mergeRules(config, ...rulesSet) {
|
|
@@ -58,15 +22,15 @@ function mergeRuleOptions(rule, options) {
|
|
|
58
22
|
}
|
|
59
23
|
|
|
60
24
|
// src/configs/eslint-comments.ts
|
|
61
|
-
var eslintCommentsStrict = mergeRules(
|
|
25
|
+
var eslintCommentsStrict = mergeRules(_configs2.default.recommended, {
|
|
62
26
|
"@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
|
|
63
27
|
});
|
|
64
28
|
|
|
65
29
|
// src/configs/imports.ts
|
|
66
|
-
var
|
|
67
|
-
|
|
30
|
+
var _eslintpluginimport = require('eslint-plugin-import'); var pluginImport = _interopRequireWildcard(_eslintpluginimport);
|
|
31
|
+
|
|
68
32
|
var importsStrict = mergeRules(
|
|
69
|
-
|
|
33
|
+
pluginImport.flatConfigs.recommended,
|
|
70
34
|
// https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#helpful-warnings
|
|
71
35
|
{
|
|
72
36
|
"import/no-deprecated": "off",
|
|
@@ -177,7 +141,7 @@ function imports({
|
|
|
177
141
|
typescript = false,
|
|
178
142
|
...config
|
|
179
143
|
}) {
|
|
180
|
-
return
|
|
144
|
+
return _typescripteslint2.default.config(
|
|
181
145
|
importsStrict,
|
|
182
146
|
config,
|
|
183
147
|
// allow default export in config files
|
|
@@ -201,7 +165,7 @@ function imports({
|
|
|
201
165
|
} : {},
|
|
202
166
|
typescript ? {
|
|
203
167
|
extends: [
|
|
204
|
-
|
|
168
|
+
pluginImport.flatConfigs.typescript,
|
|
205
169
|
{
|
|
206
170
|
rules: {
|
|
207
171
|
"import/extensions": [
|
|
@@ -237,12 +201,12 @@ function imports({
|
|
|
237
201
|
}
|
|
238
202
|
|
|
239
203
|
// src/configs/js.ts
|
|
240
|
-
var
|
|
241
|
-
var
|
|
242
|
-
var
|
|
243
|
-
|
|
204
|
+
var _js = require('@eslint/js'); var _js2 = _interopRequireDefault(_js);
|
|
205
|
+
var _confusingbrowserglobals = require('confusing-browser-globals'); var _confusingbrowserglobals2 = _interopRequireDefault(_confusingbrowserglobals);
|
|
206
|
+
var _globals = require('globals'); var _globals2 = _interopRequireDefault(_globals);
|
|
207
|
+
|
|
244
208
|
var jsStrict = mergeRules(
|
|
245
|
-
|
|
209
|
+
_js2.default.configs.recommended,
|
|
246
210
|
{
|
|
247
211
|
"no-empty": "warn",
|
|
248
212
|
// override recommended in suggestions
|
|
@@ -373,7 +337,7 @@ var jsStrict = mergeRules(
|
|
|
373
337
|
// see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/es6.js#L65
|
|
374
338
|
"no-restricted-exports": ["error", { restrictedNamedExports: ["default", "then"] }],
|
|
375
339
|
// see https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/variables.js#L19
|
|
376
|
-
"no-restricted-globals": ["error", ...
|
|
340
|
+
"no-restricted-globals": ["error", ..._confusingbrowserglobals2.default],
|
|
377
341
|
"no-restricted-imports": "off",
|
|
378
342
|
// allow all imports
|
|
379
343
|
"no-restricted-properties": "off",
|
|
@@ -476,16 +440,16 @@ function jsGlobals({
|
|
|
476
440
|
es2025 = true,
|
|
477
441
|
node = true
|
|
478
442
|
}) {
|
|
479
|
-
return
|
|
443
|
+
return _typescripteslint2.default.config({
|
|
480
444
|
languageOptions: {
|
|
481
445
|
globals: {
|
|
482
|
-
...es2021 ?
|
|
483
|
-
...es2022 ?
|
|
484
|
-
...es2023 ?
|
|
485
|
-
...es2024 ?
|
|
486
|
-
...es2025 ?
|
|
487
|
-
...browser ?
|
|
488
|
-
...node ?
|
|
446
|
+
...es2021 ? _globals2.default.es2021 : {},
|
|
447
|
+
...es2022 ? _globals2.default.es2022 : {},
|
|
448
|
+
...es2023 ? _globals2.default.es2023 : {},
|
|
449
|
+
...es2024 ? _globals2.default.es2024 : {},
|
|
450
|
+
...es2025 ? _globals2.default.es2025 : {},
|
|
451
|
+
...browser ? _globals2.default.browser : {},
|
|
452
|
+
...node ? _globals2.default.node : {}
|
|
489
453
|
}
|
|
490
454
|
}
|
|
491
455
|
});
|
|
@@ -494,12 +458,12 @@ function js({
|
|
|
494
458
|
globals = {},
|
|
495
459
|
...config
|
|
496
460
|
}) {
|
|
497
|
-
return
|
|
461
|
+
return _typescripteslint2.default.config(globals ? jsGlobals(globals) : {}, jsStrict, config);
|
|
498
462
|
}
|
|
499
463
|
|
|
500
464
|
// src/configs/jsx-a11y.ts
|
|
501
|
-
var
|
|
502
|
-
var jsxA11yStrict = mergeRules(
|
|
465
|
+
var _eslintpluginjsxa11y = require('eslint-plugin-jsx-a11y'); var _eslintpluginjsxa11y2 = _interopRequireDefault(_eslintpluginjsxa11y);
|
|
466
|
+
var jsxA11yStrict = mergeRules(_eslintpluginjsxa11y2.default.flatConfigs.recommended, {
|
|
503
467
|
"jsx-a11y/accessible-emoji": "off",
|
|
504
468
|
// deprecated
|
|
505
469
|
"jsx-a11y/lang": "error",
|
|
@@ -510,14 +474,15 @@ var jsxA11yStrict = mergeRules(import_eslint_plugin_jsx_a11y.default.flatConfigs
|
|
|
510
474
|
});
|
|
511
475
|
|
|
512
476
|
// src/configs/perfectionist.ts
|
|
513
|
-
var
|
|
477
|
+
var _eslintpluginperfectionist = require('eslint-plugin-perfectionist'); var _eslintpluginperfectionist2 = _interopRequireDefault(_eslintpluginperfectionist);
|
|
514
478
|
var perfectionistRecommended = {
|
|
515
|
-
...
|
|
516
|
-
rules:
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
479
|
+
..._eslintpluginperfectionist2.default.configs["recommended-natural"],
|
|
480
|
+
rules: _nullishCoalesce(_eslintpluginperfectionist2.default.configs["recommended-natural"].rules, () => ( {})),
|
|
481
|
+
settings: {
|
|
482
|
+
perfectionist: {
|
|
483
|
+
ignoreCase: false
|
|
484
|
+
}
|
|
485
|
+
}
|
|
521
486
|
};
|
|
522
487
|
var perfectionistStrict = mergeRules(
|
|
523
488
|
perfectionistRecommended,
|
|
@@ -595,9 +560,9 @@ var perfectionistStrict = mergeRules(
|
|
|
595
560
|
);
|
|
596
561
|
|
|
597
562
|
// src/configs/react.ts
|
|
598
|
-
var
|
|
599
|
-
|
|
600
|
-
var reactStrict = mergeRules(
|
|
563
|
+
var _eslintpluginreact = require('eslint-plugin-react'); var _eslintpluginreact2 = _interopRequireDefault(_eslintpluginreact);
|
|
564
|
+
|
|
565
|
+
var reactStrict = mergeRules(_nullishCoalesce(_eslintpluginreact2.default.configs.flat.recommended, () => ( {})), {
|
|
601
566
|
"react/boolean-prop-naming": "off",
|
|
602
567
|
"react/button-has-type": ["error", { button: true, reset: false, submit: true }],
|
|
603
568
|
"react/checked-requires-onchange-or-readonly": "off",
|
|
@@ -719,7 +684,7 @@ var reactStrict = mergeRules(import_eslint_plugin_react.default.configs.flat.rec
|
|
|
719
684
|
"react/void-dom-elements-no-children": "error"
|
|
720
685
|
});
|
|
721
686
|
function react(config) {
|
|
722
|
-
return
|
|
687
|
+
return _typescripteslint2.default.config(
|
|
723
688
|
{
|
|
724
689
|
settings: {
|
|
725
690
|
react: {
|
|
@@ -729,29 +694,29 @@ function react(config) {
|
|
|
729
694
|
},
|
|
730
695
|
{
|
|
731
696
|
...config,
|
|
732
|
-
extends: [reactStrict, ...config.extends
|
|
697
|
+
extends: [reactStrict, ..._nullishCoalesce(config.extends, () => ( []))],
|
|
733
698
|
files: ["**/*.{jsx,tsx}"]
|
|
734
699
|
}
|
|
735
700
|
);
|
|
736
701
|
}
|
|
737
702
|
|
|
738
703
|
// src/configs/react-hooks.ts
|
|
739
|
-
var
|
|
704
|
+
var _eslintpluginreacthooks = require('eslint-plugin-react-hooks'); var _eslintpluginreacthooks2 = _interopRequireDefault(_eslintpluginreacthooks);
|
|
740
705
|
var reactHooksStrict = mergeRules(
|
|
741
706
|
// Flat Config version has not been released yet.
|
|
742
707
|
{
|
|
743
|
-
plugins: { "react-hooks":
|
|
744
|
-
rules:
|
|
708
|
+
plugins: { "react-hooks": _eslintpluginreacthooks2.default },
|
|
709
|
+
rules: _eslintpluginreacthooks2.default.configs.recommended.rules
|
|
745
710
|
}
|
|
746
711
|
);
|
|
747
712
|
|
|
748
713
|
// src/configs/react-refresh.ts
|
|
749
|
-
var
|
|
750
|
-
var reactRefreshStrict = mergeRules(
|
|
714
|
+
var _eslintpluginreactrefresh = require('eslint-plugin-react-refresh'); var _eslintpluginreactrefresh2 = _interopRequireDefault(_eslintpluginreactrefresh);
|
|
715
|
+
var reactRefreshStrict = mergeRules(_eslintpluginreactrefresh2.default.configs.recommended);
|
|
751
716
|
|
|
752
717
|
// src/configs/ts.ts
|
|
753
|
-
|
|
754
|
-
var jsStrictRules = jsStrict.rules
|
|
718
|
+
|
|
719
|
+
var jsStrictRules = _nullishCoalesce(jsStrict.rules, () => ( {}));
|
|
755
720
|
var tsEslintOverrideRules = mergeRules(
|
|
756
721
|
{},
|
|
757
722
|
// see https://github.com/typescript-eslint/typescript-eslint/blob/v8.22.0/packages/eslint-plugin/src/configs/strict-type-checked.ts
|
|
@@ -830,14 +795,14 @@ var tsRecommendedOverride = mergeRules(
|
|
|
830
795
|
// confilict with @typescript-eslint/consistent-type-imports
|
|
831
796
|
}
|
|
832
797
|
);
|
|
833
|
-
var tsRecommended =
|
|
834
|
-
|
|
798
|
+
var tsRecommended = _typescripteslint2.default.config(
|
|
799
|
+
_typescripteslint2.default.configs.recommended,
|
|
835
800
|
tsEslintOverrideRules,
|
|
836
801
|
tsRecommendedOverride
|
|
837
802
|
);
|
|
838
|
-
var tsStrict =
|
|
839
|
-
|
|
840
|
-
|
|
803
|
+
var tsStrict = _typescripteslint2.default.config(
|
|
804
|
+
_typescripteslint2.default.configs.strictTypeChecked,
|
|
805
|
+
_typescripteslint2.default.configs.stylisticTypeChecked,
|
|
841
806
|
tsEslintOverrideRules,
|
|
842
807
|
tsRecommendedOverride,
|
|
843
808
|
{
|
|
@@ -894,7 +859,7 @@ function ts({
|
|
|
894
859
|
strict = true,
|
|
895
860
|
...config
|
|
896
861
|
}) {
|
|
897
|
-
return
|
|
862
|
+
return _typescripteslint2.default.config(
|
|
898
863
|
parserOptions ? {
|
|
899
864
|
languageOptions: {
|
|
900
865
|
parserOptions: {
|
|
@@ -906,18 +871,18 @@ function ts({
|
|
|
906
871
|
strict ? tsStrict : tsRecommended,
|
|
907
872
|
config,
|
|
908
873
|
disableTypeChecked ? {
|
|
909
|
-
extends: [
|
|
874
|
+
extends: [_typescripteslint2.default.configs.disableTypeChecked],
|
|
910
875
|
files: ["**/*.{js,jsx,mjs,cjs}"]
|
|
911
876
|
} : {}
|
|
912
877
|
);
|
|
913
878
|
}
|
|
914
879
|
|
|
915
880
|
// src/configs/unused-imports.ts
|
|
916
|
-
var
|
|
917
|
-
var jsStrictRules2 = jsStrict.rules
|
|
881
|
+
var _eslintpluginunusedimports = require('eslint-plugin-unused-imports'); var _eslintpluginunusedimports2 = _interopRequireDefault(_eslintpluginunusedimports);
|
|
882
|
+
var jsStrictRules2 = _nullishCoalesce(jsStrict.rules, () => ( {}));
|
|
918
883
|
var unusedImportsStrict = mergeRules({
|
|
919
884
|
plugins: {
|
|
920
|
-
"unused-imports":
|
|
885
|
+
"unused-imports": _eslintpluginunusedimports2.default
|
|
921
886
|
},
|
|
922
887
|
rules: {
|
|
923
888
|
"@typescript-eslint/no-unused-vars": "off",
|
|
@@ -928,9 +893,9 @@ var unusedImportsStrict = mergeRules({
|
|
|
928
893
|
});
|
|
929
894
|
|
|
930
895
|
// src/configs/vitest.ts
|
|
931
|
-
var
|
|
932
|
-
|
|
933
|
-
var vitestStrict = mergeRules(
|
|
896
|
+
var _eslintplugin = require('@vitest/eslint-plugin'); var _eslintplugin2 = _interopRequireDefault(_eslintplugin);
|
|
897
|
+
|
|
898
|
+
var vitestStrict = mergeRules(_eslintplugin2.default.configs.recommended, {
|
|
934
899
|
"vitest/consistent-test-filename": "off",
|
|
935
900
|
"vitest/consistent-test-it": "error",
|
|
936
901
|
"vitest/max-expects": "off",
|
|
@@ -992,19 +957,19 @@ var vitestStrict = mergeRules(import_eslint_plugin.default.configs.recommended,
|
|
|
992
957
|
"vitest/valid-expect-in-promise": "error"
|
|
993
958
|
});
|
|
994
959
|
function vitest(config) {
|
|
995
|
-
return
|
|
960
|
+
return _typescripteslint2.default.config({
|
|
996
961
|
extends: [vitestStrict, config],
|
|
997
962
|
files: ["tests/**", "*.test.*"]
|
|
998
963
|
});
|
|
999
964
|
}
|
|
1000
965
|
|
|
1001
966
|
// src/configs/unicorn.ts
|
|
1002
|
-
var
|
|
967
|
+
var _eslintpluginunicorn = require('eslint-plugin-unicorn'); var _eslintpluginunicorn2 = _interopRequireDefault(_eslintpluginunicorn);
|
|
1003
968
|
var unicornRecommended = mergeRules(
|
|
1004
969
|
{
|
|
1005
|
-
...
|
|
970
|
+
..._eslintpluginunicorn2.default.configs["flat/recommended"],
|
|
1006
971
|
rules: Object.fromEntries(
|
|
1007
|
-
Object.entries(
|
|
972
|
+
Object.entries(_nullishCoalesce(_eslintpluginunicorn2.default.configs["flat/recommended"].rules, () => ( {}))).filter(
|
|
1008
973
|
([_key, value]) => value !== "off"
|
|
1009
974
|
)
|
|
1010
975
|
)
|
|
@@ -1093,7 +1058,7 @@ function defineBaseConfig({
|
|
|
1093
1058
|
vitest: vitestOptions = {},
|
|
1094
1059
|
...config
|
|
1095
1060
|
} = {}) {
|
|
1096
|
-
return
|
|
1061
|
+
return _typescripteslint2.default.config(
|
|
1097
1062
|
settings ? { settings } : {},
|
|
1098
1063
|
ignores ? { ignores } : {},
|
|
1099
1064
|
jsOptions ? js(jsOptions) : {},
|
|
@@ -1109,8 +1074,8 @@ function defineBaseConfig({
|
|
|
1109
1074
|
}
|
|
1110
1075
|
|
|
1111
1076
|
// src/react.ts
|
|
1112
|
-
|
|
1113
|
-
|
|
1077
|
+
|
|
1078
|
+
|
|
1114
1079
|
function defineReactConfig({
|
|
1115
1080
|
jsxA11y: enabledJsxA11y = true,
|
|
1116
1081
|
jsxRuntime: enabledJsxRuntime = true,
|
|
@@ -1118,15 +1083,15 @@ function defineReactConfig({
|
|
|
1118
1083
|
reactRefresh: enabledReactRefresh = true,
|
|
1119
1084
|
...reactOptions
|
|
1120
1085
|
} = {}) {
|
|
1121
|
-
return
|
|
1086
|
+
return _typescripteslint2.default.config(
|
|
1122
1087
|
react({
|
|
1123
1088
|
...reactOptions,
|
|
1124
1089
|
extends: [
|
|
1125
|
-
enabledJsxRuntime ?
|
|
1090
|
+
enabledJsxRuntime ? _eslintpluginreact2.default.configs.flat["jsx-runtime"] : {},
|
|
1126
1091
|
enabledReactHooks ? reactHooksStrict : {},
|
|
1127
1092
|
enabledReactRefresh ? reactRefreshStrict : {},
|
|
1128
1093
|
enabledJsxA11y ? jsxA11yStrict : {},
|
|
1129
|
-
...reactOptions.extends
|
|
1094
|
+
..._nullishCoalesce(reactOptions.extends, () => ( []))
|
|
1130
1095
|
]
|
|
1131
1096
|
})
|
|
1132
1097
|
);
|
|
@@ -1147,7 +1112,7 @@ function defineConfig({
|
|
|
1147
1112
|
return defineBaseConfig({
|
|
1148
1113
|
...config,
|
|
1149
1114
|
eslintComments: eslintCommentsOptions,
|
|
1150
|
-
extends: [reactOptions ? defineReactConfig(reactOptions) : {}, ...config.extends
|
|
1115
|
+
extends: [reactOptions ? defineReactConfig(reactOptions) : {}, ..._nullishCoalesce(config.extends, () => ( []))],
|
|
1151
1116
|
imports: importsOptions,
|
|
1152
1117
|
js: jsOptions,
|
|
1153
1118
|
perfectionist: perfectionistOptions,
|
|
@@ -1156,3 +1121,8 @@ function defineConfig({
|
|
|
1156
1121
|
vitest: vitestOptions
|
|
1157
1122
|
});
|
|
1158
1123
|
}
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
exports.default = defineConfig;
|
|
1127
|
+
|
|
1128
|
+
module.exports = exports.default;
|
package/dist/index.mjs
CHANGED
|
@@ -27,7 +27,7 @@ var eslintCommentsStrict = mergeRules(pluginEslintComments.recommended, {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
// src/configs/imports.ts
|
|
30
|
-
import pluginImport from "eslint-plugin-import";
|
|
30
|
+
import * as pluginImport from "eslint-plugin-import";
|
|
31
31
|
import pluginTs from "typescript-eslint";
|
|
32
32
|
var importsStrict = mergeRules(
|
|
33
33
|
pluginImport.flatConfigs.recommended,
|
|
@@ -477,11 +477,12 @@ var jsxA11yStrict = mergeRules(pluginJsxA11y.flatConfigs.recommended, {
|
|
|
477
477
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
478
478
|
var perfectionistRecommended = {
|
|
479
479
|
...pluginPerfectionist.configs["recommended-natural"],
|
|
480
|
-
rules:
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
480
|
+
rules: pluginPerfectionist.configs["recommended-natural"].rules ?? {},
|
|
481
|
+
settings: {
|
|
482
|
+
perfectionist: {
|
|
483
|
+
ignoreCase: false
|
|
484
|
+
}
|
|
485
|
+
}
|
|
485
486
|
};
|
|
486
487
|
var perfectionistStrict = mergeRules(
|
|
487
488
|
perfectionistRecommended,
|
package/package.json
CHANGED
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ofk/eslint-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ofk (https://github.com/ofk/)",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"import":
|
|
10
|
-
|
|
9
|
+
"import": {
|
|
10
|
+
"types": "./dist/index.d.mts",
|
|
11
|
+
"default": "./dist/index.mjs"
|
|
12
|
+
},
|
|
13
|
+
"require": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
}
|
|
11
17
|
}
|
|
12
18
|
},
|
|
13
|
-
"main": "./dist/index.js",
|
|
14
19
|
"files": [
|
|
15
20
|
"dist"
|
|
16
21
|
],
|
|
17
22
|
"scripts": {
|
|
18
23
|
"build": "tsup",
|
|
24
|
+
"prelint": "npm run build",
|
|
19
25
|
"lint": "run-s lint:*",
|
|
20
|
-
"lint:eslint": "eslint .",
|
|
26
|
+
"lint:eslint": "eslint --config eslint.config.mjs .",
|
|
27
|
+
"lint:eslint-cjs": "eslint --config eslint.config.cjs .",
|
|
21
28
|
"lint:prettier": "prettier --check .",
|
|
22
29
|
"lint:prettier-package-json": "prettier-package-json --list-different",
|
|
30
|
+
"prelint-fix": "npm run build",
|
|
23
31
|
"lint-fix": "run-s lint-fix:*",
|
|
24
|
-
"lint-fix:eslint": "eslint --fix .",
|
|
32
|
+
"lint-fix:eslint": "eslint --config eslint.config.mjs --fix .",
|
|
25
33
|
"lint-fix:prettier": "prettier --write .",
|
|
26
34
|
"lint-fix:prettier-package-json": "prettier-package-json --write",
|
|
27
35
|
"prepare": "husky",
|
|
@@ -29,7 +37,7 @@
|
|
|
29
37
|
"test": "run-s lint test:*",
|
|
30
38
|
"test:vitest": "vitest run"
|
|
31
39
|
},
|
|
32
|
-
"
|
|
40
|
+
"sideEffects": false,
|
|
33
41
|
"peerDependencies": {
|
|
34
42
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
35
43
|
"@eslint/js": "^9.18.0",
|
|
@@ -113,7 +121,6 @@
|
|
|
113
121
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
114
122
|
"globals": "^16.0.0",
|
|
115
123
|
"husky": "^9.1.7",
|
|
116
|
-
"jiti": "^2.4.2",
|
|
117
124
|
"lint-staged": "^15.5.0",
|
|
118
125
|
"npm-run-all": "^4.1.5",
|
|
119
126
|
"prettier": "^3.5.3",
|
|
@@ -125,10 +132,14 @@
|
|
|
125
132
|
},
|
|
126
133
|
"keywords": [],
|
|
127
134
|
"lint-staged": {
|
|
128
|
-
"*.{json,ts}": "prettier --write",
|
|
129
135
|
"package.json": [
|
|
130
136
|
"prettier --write",
|
|
131
137
|
"npm run lint-fix:prettier-package-json"
|
|
138
|
+
],
|
|
139
|
+
"*.{json,md,html}": "prettier --write",
|
|
140
|
+
"*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}": [
|
|
141
|
+
"prettier --write",
|
|
142
|
+
"eslint --fix"
|
|
132
143
|
]
|
|
133
144
|
},
|
|
134
145
|
"packageManager": "npm@10.8.0+sha512.c21f77b91733829ec70e73cc88b5dc0a4bf685a81d252d3327d293ff7d5dd05a173f4dbeaa037600ec29696f397f14569229e5dab10b7cfc3e0a30575b8f3f8d"
|