@ntnyq/eslint-config 3.0.1 → 3.1.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/README.md +6 -1
- package/dist/index.cjs +118 -98
- package/dist/index.d.cts +190 -143
- package/dist/index.d.ts +190 -143
- package/dist/index.js +118 -98
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -209,17 +209,13 @@ var typescriptCore = (options = {}) => {
|
|
|
209
209
|
}
|
|
210
210
|
],
|
|
211
211
|
"@typescript-eslint/prefer-as-const": "warn",
|
|
212
|
-
"@typescript-eslint/ban-types": "off",
|
|
213
|
-
"@typescript-eslint/camelcase": "off",
|
|
214
212
|
"@typescript-eslint/no-namespace": "off",
|
|
215
|
-
"@typescript-eslint/ban-ts-ignore": "off",
|
|
216
213
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
217
214
|
"@typescript-eslint/no-explicit-any": "off",
|
|
218
215
|
"@typescript-eslint/no-empty-function": "off",
|
|
219
216
|
"@typescript-eslint/naming-convention": "off",
|
|
220
217
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
221
218
|
"@typescript-eslint/triple-slash-reference": "off",
|
|
222
|
-
"@typescript-eslint/no-parameter-properties": "off",
|
|
223
219
|
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
224
220
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
225
221
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
@@ -785,30 +781,34 @@ var sort = (options = {}) => {
|
|
|
785
781
|
});
|
|
786
782
|
}
|
|
787
783
|
if (options.i18nLocale ?? true) {
|
|
788
|
-
configs.push(
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
784
|
+
configs.push(
|
|
785
|
+
{
|
|
786
|
+
name: "ntnyq/sort/i18n-locale/json",
|
|
787
|
+
files: ["**/{locales,i18n}/*.json"],
|
|
788
|
+
rules: {
|
|
789
|
+
"jsonc/sort-keys": [
|
|
790
|
+
"error",
|
|
791
|
+
{
|
|
792
|
+
pathPattern: ".*",
|
|
793
|
+
order: { type: "asc" }
|
|
794
|
+
}
|
|
795
|
+
]
|
|
796
|
+
}
|
|
794
797
|
},
|
|
795
|
-
|
|
796
|
-
"
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
order: { type: "asc" }
|
|
808
|
-
}
|
|
809
|
-
]
|
|
798
|
+
{
|
|
799
|
+
name: "ntnyq/sort/i18n-locale/yaml",
|
|
800
|
+
files: ["**/{locales,i18n}/*.y?(a)ml"],
|
|
801
|
+
rules: {
|
|
802
|
+
"yml/sort-keys": [
|
|
803
|
+
"error",
|
|
804
|
+
{
|
|
805
|
+
pathPattern: ".*",
|
|
806
|
+
order: { type: "asc" }
|
|
807
|
+
}
|
|
808
|
+
]
|
|
809
|
+
}
|
|
810
810
|
}
|
|
811
|
-
|
|
811
|
+
);
|
|
812
812
|
}
|
|
813
813
|
return configs;
|
|
814
814
|
};
|
|
@@ -988,17 +988,30 @@ var ntnyq = (options = {}) => [
|
|
|
988
988
|
];
|
|
989
989
|
|
|
990
990
|
// src/configs/regexp.ts
|
|
991
|
-
var regexp = (options = {}) =>
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
991
|
+
var regexp = (options = {}) => {
|
|
992
|
+
const config = pluginRegexp.configs["flat/recommended"];
|
|
993
|
+
const rules = {
|
|
994
|
+
...config.rules
|
|
995
|
+
};
|
|
996
|
+
if (options.level === "warn") {
|
|
997
|
+
for (const key in rules) {
|
|
998
|
+
if (rules[key] === "error") {
|
|
999
|
+
rules[key] = "warn";
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1000
1002
|
}
|
|
1001
|
-
|
|
1003
|
+
return [
|
|
1004
|
+
{
|
|
1005
|
+
...config,
|
|
1006
|
+
name: "ntnyq/regexp",
|
|
1007
|
+
rules: {
|
|
1008
|
+
...rules,
|
|
1009
|
+
// Overrides rules
|
|
1010
|
+
...options.overrides
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
];
|
|
1014
|
+
};
|
|
1002
1015
|
|
|
1003
1016
|
// src/configs/unocss.ts
|
|
1004
1017
|
var unocss = (options = {}) => [
|
|
@@ -1247,70 +1260,76 @@ var markdown = (options = {}) => {
|
|
|
1247
1260
|
};
|
|
1248
1261
|
|
|
1249
1262
|
// src/configs/prettier.ts
|
|
1250
|
-
var prettier = (options = {}) =>
|
|
1251
|
-
{
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
name: "ntnyq/prettier/disabled",
|
|
1305
|
-
files: [GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
|
|
1306
|
-
plugins: {
|
|
1307
|
-
prettier: default15
|
|
1263
|
+
var prettier = (options = {}) => {
|
|
1264
|
+
const {
|
|
1265
|
+
disabledFiles = [GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
|
|
1266
|
+
userDisabledFiles = []
|
|
1267
|
+
} = options;
|
|
1268
|
+
return [
|
|
1269
|
+
{
|
|
1270
|
+
name: "ntnyq/prettier",
|
|
1271
|
+
plugins: {
|
|
1272
|
+
prettier: default15
|
|
1273
|
+
},
|
|
1274
|
+
rules: {
|
|
1275
|
+
"vue/array-bracket-newline": "off",
|
|
1276
|
+
"vue/array-bracket-spacing": "off",
|
|
1277
|
+
"vue/array-element-newline": "off",
|
|
1278
|
+
"vue/arrow-spacing": "off",
|
|
1279
|
+
"vue/block-spacing": "off",
|
|
1280
|
+
"vue/block-tag-newline": "off",
|
|
1281
|
+
"vue/brace-style": "off",
|
|
1282
|
+
"vue/comma-dangle": "off",
|
|
1283
|
+
"vue/comma-spacing": "off",
|
|
1284
|
+
"vue/comma-style": "off",
|
|
1285
|
+
"vue/dot-location": "off",
|
|
1286
|
+
"vue/func-call-spacing": "off",
|
|
1287
|
+
"vue/html-closing-bracket-newline": "off",
|
|
1288
|
+
"vue/html-closing-bracket-spacing": "off",
|
|
1289
|
+
"vue/html-end-tags": "off",
|
|
1290
|
+
"vue/html-indent": "off",
|
|
1291
|
+
"vue/html-quotes": "off",
|
|
1292
|
+
"vue/key-spacing": "off",
|
|
1293
|
+
"vue/keyword-spacing": "off",
|
|
1294
|
+
"vue/max-attributes-per-line": "off",
|
|
1295
|
+
"vue/multiline-html-element-content-newline": "off",
|
|
1296
|
+
"vue/multiline-ternary": "off",
|
|
1297
|
+
"vue/mustache-interpolation-spacing": "off",
|
|
1298
|
+
"vue/no-extra-parens": "off",
|
|
1299
|
+
"vue/no-multi-spaces": "off",
|
|
1300
|
+
"vue/no-spaces-around-equal-signs-in-attribute": "off",
|
|
1301
|
+
"vue/object-curly-newline": "off",
|
|
1302
|
+
"vue/object-curly-spacing": "off",
|
|
1303
|
+
"vue/object-property-newline": "off",
|
|
1304
|
+
"vue/operator-linebreak": "off",
|
|
1305
|
+
"vue/quote-props": "off",
|
|
1306
|
+
"vue/script-indent": "off",
|
|
1307
|
+
"vue/singleline-html-element-content-newline": "off",
|
|
1308
|
+
"vue/space-in-parens": "off",
|
|
1309
|
+
"vue/space-infix-ops": "off",
|
|
1310
|
+
"vue/space-unary-ops": "off",
|
|
1311
|
+
"vue/template-curly-spacing": "off",
|
|
1312
|
+
...default15.configs.recommended.rules,
|
|
1313
|
+
"prettier/prettier": options.level || "warn",
|
|
1314
|
+
// Overrides rules
|
|
1315
|
+
...options.overrides
|
|
1316
|
+
}
|
|
1308
1317
|
},
|
|
1309
|
-
|
|
1310
|
-
|
|
1318
|
+
/**
|
|
1319
|
+
* Languages that prettier currently does not support
|
|
1320
|
+
*/
|
|
1321
|
+
{
|
|
1322
|
+
name: "ntnyq/prettier/disabled",
|
|
1323
|
+
files: [...disabledFiles, ...userDisabledFiles],
|
|
1324
|
+
plugins: {
|
|
1325
|
+
prettier: default15
|
|
1326
|
+
},
|
|
1327
|
+
rules: {
|
|
1328
|
+
"prettier/prettier": "off"
|
|
1329
|
+
}
|
|
1311
1330
|
}
|
|
1312
|
-
|
|
1313
|
-
|
|
1331
|
+
];
|
|
1332
|
+
};
|
|
1314
1333
|
|
|
1315
1334
|
// src/configs/gitignore.ts
|
|
1316
1335
|
import createGitIgnoreConfig from "eslint-config-flat-gitignore";
|
|
@@ -1754,6 +1773,7 @@ function defineESLintConfig(options = {}, userConfigs = []) {
|
|
|
1754
1773
|
if (options.regexp ?? true) {
|
|
1755
1774
|
configs.push(
|
|
1756
1775
|
...regexp({
|
|
1776
|
+
...resolveSubOptions(options, "regexp"),
|
|
1757
1777
|
overrides: getOverrides(options, "regexp")
|
|
1758
1778
|
})
|
|
1759
1779
|
);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0
|
|
5
|
-
"packageManager": "pnpm@9.12.
|
|
4
|
+
"version": "3.1.0",
|
|
5
|
+
"packageManager": "pnpm@9.12.2",
|
|
6
6
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"eslint",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
59
59
|
"@eslint/js": "^9.12.0",
|
|
60
|
-
"@eslint/markdown": "^6.2.
|
|
60
|
+
"@eslint/markdown": "^6.2.1",
|
|
61
61
|
"@types/eslint__js": "^8.42.3",
|
|
62
62
|
"@unocss/eslint-plugin": "^0.63.4",
|
|
63
63
|
"@vitest/eslint-plugin": "^1.1.7",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"eslint-plugin-antfu": "^2.7.0",
|
|
68
68
|
"eslint-plugin-command": "^0.2.6",
|
|
69
69
|
"eslint-plugin-import-x": "^4.3.1",
|
|
70
|
-
"eslint-plugin-jsdoc": "^50.3
|
|
70
|
+
"eslint-plugin-jsdoc": "^50.4.3",
|
|
71
71
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
72
72
|
"eslint-plugin-n": "^17.11.1",
|
|
73
73
|
"eslint-plugin-ntnyq": "^0.5.0",
|
|
74
|
-
"eslint-plugin-perfectionist": "^3.
|
|
74
|
+
"eslint-plugin-perfectionist": "^3.9.1",
|
|
75
75
|
"eslint-plugin-prettier": "^5.2.1",
|
|
76
76
|
"eslint-plugin-regexp": "^2.6.0",
|
|
77
77
|
"eslint-plugin-toml": "^0.11.1",
|
|
@@ -84,20 +84,20 @@
|
|
|
84
84
|
"local-pkg": "^0.5.0",
|
|
85
85
|
"prettier": "^3.3.3",
|
|
86
86
|
"toml-eslint-parser": "^0.10.0",
|
|
87
|
-
"typescript-eslint": "^8.
|
|
87
|
+
"typescript-eslint": "^8.10.0",
|
|
88
88
|
"vue-eslint-parser": "^9.4.3",
|
|
89
89
|
"yaml-eslint-parser": "^1.2.3"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@ntnyq/prettier-config": "^1.21.3",
|
|
93
|
-
"@types/node": "^22.7.
|
|
93
|
+
"@types/node": "^22.7.6",
|
|
94
94
|
"bumpp": "^9.7.1",
|
|
95
95
|
"eslint": "^9.12.0",
|
|
96
96
|
"eslint-typegen": "^0.3.2",
|
|
97
97
|
"husky": "^9.1.6",
|
|
98
98
|
"jiti": "^2.3.3",
|
|
99
99
|
"nano-staged": "^0.8.0",
|
|
100
|
-
"npm-run-all2": "^6.2.
|
|
100
|
+
"npm-run-all2": "^6.2.4",
|
|
101
101
|
"rimraf": "^6.0.1",
|
|
102
102
|
"tsup": "^8.3.0",
|
|
103
103
|
"tsx": "^4.19.1",
|