@ntnyq/eslint-config 3.0.2 → 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 CHANGED
@@ -5,10 +5,14 @@
5
5
  [![CI](https://github.com/ntnyq/eslint-config/workflows/CI/badge.svg)](https://github.com/ntnyq/eslint-config/actions)
6
6
  [![NPM DOWNLOADS](https://img.shields.io/npm/dy/@ntnyq/eslint-config)](https://www.npmjs.com/package/@ntnyq/eslint-config)
7
7
  [![NPM VERSION](https://img.shields.io/npm/v/@ntnyq/eslint-config/latest.svg)](https://www.npmjs.com/package/@ntnyq/eslint-config/v/latest)
8
+ [![LICENSE](https://img.shields.io/github/license/ntnyq/eslint-config.svg)](https://github.com/ntnyq/eslint-config/blob/main/LICENSE)
8
9
 
9
10
  ## Features
10
11
 
11
- - 🚦 Designed to work alongside with Prettier
12
+ - Opinionable: single quotes, no semi
13
+ - Designed to work alongside with [Prettier](https://prettier.io)
14
+ - Out-of-box support for TypeScript, Vue, JSON, Markdown, YAML, etc.
15
+ - [ESLint flat config](https://eslint.org/docs/latest/use/configure/configuration-files) for ESLint v9.5.0+
12
16
 
13
17
  ## Install
14
18
 
@@ -47,6 +51,7 @@ Add scripts `lint` in `package.json`:
47
51
  "editor.codeActionsOnSave": {
48
52
  "source.fixAll.eslint": "explicit"
49
53
  },
54
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
50
55
  "eslint.validate": [
51
56
  "vue",
52
57
  "html",
package/dist/index.cjs CHANGED
@@ -334,17 +334,13 @@ var typescriptCore = (options = {}) => {
334
334
  }
335
335
  ],
336
336
  "@typescript-eslint/prefer-as-const": "warn",
337
- "@typescript-eslint/ban-types": "off",
338
- "@typescript-eslint/camelcase": "off",
339
337
  "@typescript-eslint/no-namespace": "off",
340
- "@typescript-eslint/ban-ts-ignore": "off",
341
338
  "@typescript-eslint/ban-ts-comment": "off",
342
339
  "@typescript-eslint/no-explicit-any": "off",
343
340
  "@typescript-eslint/no-empty-function": "off",
344
341
  "@typescript-eslint/naming-convention": "off",
345
342
  "@typescript-eslint/no-non-null-assertion": "off",
346
343
  "@typescript-eslint/triple-slash-reference": "off",
347
- "@typescript-eslint/no-parameter-properties": "off",
348
344
  "@typescript-eslint/explicit-member-accessibility": "off",
349
345
  "@typescript-eslint/explicit-function-return-type": "off",
350
346
  "@typescript-eslint/explicit-module-boundary-types": "off",
@@ -1117,17 +1113,30 @@ var ntnyq = (options = {}) => [
1117
1113
  ];
1118
1114
 
1119
1115
  // src/configs/regexp.ts
1120
- var regexp = (options = {}) => [
1121
- /**
1122
- * https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/rules/recommended.ts
1123
- */
1124
- {
1125
- name: "ntnyq/regexp",
1126
- ...pluginRegexp.configs["flat/recommended"],
1127
- // Overrides rules
1128
- ...options.overrides
1116
+ var regexp = (options = {}) => {
1117
+ const config = pluginRegexp.configs["flat/recommended"];
1118
+ const rules = {
1119
+ ...config.rules
1120
+ };
1121
+ if (options.level === "warn") {
1122
+ for (const key in rules) {
1123
+ if (rules[key] === "error") {
1124
+ rules[key] = "warn";
1125
+ }
1126
+ }
1129
1127
  }
1130
- ];
1128
+ return [
1129
+ {
1130
+ ...config,
1131
+ name: "ntnyq/regexp",
1132
+ rules: {
1133
+ ...rules,
1134
+ // Overrides rules
1135
+ ...options.overrides
1136
+ }
1137
+ }
1138
+ ];
1139
+ };
1131
1140
 
1132
1141
  // src/configs/unocss.ts
1133
1142
  var unocss = (options = {}) => [
@@ -1376,70 +1385,76 @@ var markdown = (options = {}) => {
1376
1385
  };
1377
1386
 
1378
1387
  // src/configs/prettier.ts
1379
- var prettier = (options = {}) => [
1380
- {
1381
- name: "ntnyq/prettier",
1382
- plugins: {
1383
- prettier: import_eslint_plugin_prettier.default
1384
- },
1385
- rules: {
1386
- "vue/array-bracket-newline": "off",
1387
- "vue/array-bracket-spacing": "off",
1388
- "vue/array-element-newline": "off",
1389
- "vue/arrow-spacing": "off",
1390
- "vue/block-spacing": "off",
1391
- "vue/block-tag-newline": "off",
1392
- "vue/brace-style": "off",
1393
- "vue/comma-dangle": "off",
1394
- "vue/comma-spacing": "off",
1395
- "vue/comma-style": "off",
1396
- "vue/dot-location": "off",
1397
- "vue/func-call-spacing": "off",
1398
- "vue/html-closing-bracket-newline": "off",
1399
- "vue/html-closing-bracket-spacing": "off",
1400
- "vue/html-end-tags": "off",
1401
- "vue/html-indent": "off",
1402
- "vue/html-quotes": "off",
1403
- "vue/key-spacing": "off",
1404
- "vue/keyword-spacing": "off",
1405
- "vue/max-attributes-per-line": "off",
1406
- "vue/multiline-html-element-content-newline": "off",
1407
- "vue/multiline-ternary": "off",
1408
- "vue/mustache-interpolation-spacing": "off",
1409
- "vue/no-extra-parens": "off",
1410
- "vue/no-multi-spaces": "off",
1411
- "vue/no-spaces-around-equal-signs-in-attribute": "off",
1412
- "vue/object-curly-newline": "off",
1413
- "vue/object-curly-spacing": "off",
1414
- "vue/object-property-newline": "off",
1415
- "vue/operator-linebreak": "off",
1416
- "vue/quote-props": "off",
1417
- "vue/script-indent": "off",
1418
- "vue/singleline-html-element-content-newline": "off",
1419
- "vue/space-in-parens": "off",
1420
- "vue/space-infix-ops": "off",
1421
- "vue/space-unary-ops": "off",
1422
- "vue/template-curly-spacing": "off",
1423
- ...import_eslint_plugin_prettier.default.configs.recommended.rules,
1424
- "prettier/prettier": options.level || "warn",
1425
- // Overrides rules
1426
- ...options.overrides
1427
- }
1428
- },
1429
- /**
1430
- * Languages that prettier currently does not support
1431
- */
1432
- {
1433
- name: "ntnyq/prettier/disabled",
1434
- files: [GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
1435
- plugins: {
1436
- prettier: import_eslint_plugin_prettier.default
1388
+ var prettier = (options = {}) => {
1389
+ const {
1390
+ disabledFiles = [GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
1391
+ userDisabledFiles = []
1392
+ } = options;
1393
+ return [
1394
+ {
1395
+ name: "ntnyq/prettier",
1396
+ plugins: {
1397
+ prettier: import_eslint_plugin_prettier.default
1398
+ },
1399
+ rules: {
1400
+ "vue/array-bracket-newline": "off",
1401
+ "vue/array-bracket-spacing": "off",
1402
+ "vue/array-element-newline": "off",
1403
+ "vue/arrow-spacing": "off",
1404
+ "vue/block-spacing": "off",
1405
+ "vue/block-tag-newline": "off",
1406
+ "vue/brace-style": "off",
1407
+ "vue/comma-dangle": "off",
1408
+ "vue/comma-spacing": "off",
1409
+ "vue/comma-style": "off",
1410
+ "vue/dot-location": "off",
1411
+ "vue/func-call-spacing": "off",
1412
+ "vue/html-closing-bracket-newline": "off",
1413
+ "vue/html-closing-bracket-spacing": "off",
1414
+ "vue/html-end-tags": "off",
1415
+ "vue/html-indent": "off",
1416
+ "vue/html-quotes": "off",
1417
+ "vue/key-spacing": "off",
1418
+ "vue/keyword-spacing": "off",
1419
+ "vue/max-attributes-per-line": "off",
1420
+ "vue/multiline-html-element-content-newline": "off",
1421
+ "vue/multiline-ternary": "off",
1422
+ "vue/mustache-interpolation-spacing": "off",
1423
+ "vue/no-extra-parens": "off",
1424
+ "vue/no-multi-spaces": "off",
1425
+ "vue/no-spaces-around-equal-signs-in-attribute": "off",
1426
+ "vue/object-curly-newline": "off",
1427
+ "vue/object-curly-spacing": "off",
1428
+ "vue/object-property-newline": "off",
1429
+ "vue/operator-linebreak": "off",
1430
+ "vue/quote-props": "off",
1431
+ "vue/script-indent": "off",
1432
+ "vue/singleline-html-element-content-newline": "off",
1433
+ "vue/space-in-parens": "off",
1434
+ "vue/space-infix-ops": "off",
1435
+ "vue/space-unary-ops": "off",
1436
+ "vue/template-curly-spacing": "off",
1437
+ ...import_eslint_plugin_prettier.default.configs.recommended.rules,
1438
+ "prettier/prettier": options.level || "warn",
1439
+ // Overrides rules
1440
+ ...options.overrides
1441
+ }
1437
1442
  },
1438
- rules: {
1439
- "prettier/prettier": "off"
1443
+ /**
1444
+ * Languages that prettier currently does not support
1445
+ */
1446
+ {
1447
+ name: "ntnyq/prettier/disabled",
1448
+ files: [...disabledFiles, ...userDisabledFiles],
1449
+ plugins: {
1450
+ prettier: import_eslint_plugin_prettier.default
1451
+ },
1452
+ rules: {
1453
+ "prettier/prettier": "off"
1454
+ }
1440
1455
  }
1441
- }
1442
- ];
1456
+ ];
1457
+ };
1443
1458
 
1444
1459
  // src/configs/gitignore.ts
1445
1460
  var import_eslint_config_flat_gitignore = __toESM(require("eslint-config-flat-gitignore"), 1);
@@ -1883,6 +1898,7 @@ function defineESLintConfig(options = {}, userConfigs = []) {
1883
1898
  if (options.regexp ?? true) {
1884
1899
  configs.push(
1885
1900
  ...regexp({
1901
+ ...resolveSubOptions(options, "regexp"),
1886
1902
  overrides: getOverrides(options, "regexp")
1887
1903
  })
1888
1904
  );
package/dist/index.d.cts CHANGED
@@ -1442,6 +1442,7 @@ interface RuleOptions {
1442
1442
  */
1443
1443
  'jsdoc/no-missing-syntax'?: Linter.RuleEntry<JsdocNoMissingSyntax>;
1444
1444
  /**
1445
+ * Prevents use of multiple asterisks at the beginning of lines.
1445
1446
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-multi-asterisks.md#repos-sticky-header
1446
1447
  */
1447
1448
  'jsdoc/no-multi-asterisks'?: Linter.RuleEntry<JsdocNoMultiAsterisks>;
@@ -1586,6 +1587,7 @@ interface RuleOptions {
1586
1587
  */
1587
1588
  'jsdoc/tag-lines'?: Linter.RuleEntry<JsdocTagLines>;
1588
1589
  /**
1590
+ * Auto-escape certain characters that are input within block and tag descriptions.
1589
1591
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md#repos-sticky-header
1590
1592
  */
1591
1593
  'jsdoc/text-escaping'?: Linter.RuleEntry<JsdocTextEscaping>;
@@ -12312,7 +12314,7 @@ type Yoda = [] | [("always" | "never")] | [
12312
12314
  onlyEquality?: boolean;
12313
12315
  }
12314
12316
  ];
12315
- type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/userscript';
12317
+ type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'ntnyq/ts/core__typescript-eslint/base' | 'ntnyq/ts/core__typescript-eslint/eslint-recommended' | 'ntnyq/ts/core__typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/vue/ts__ntnyq/ts/core__typescript-eslint/base' | 'ntnyq/vue/ts__ntnyq/ts/core__typescript-eslint/eslint-recommended' | 'ntnyq/vue/ts__ntnyq/ts/core__typescript-eslint/recommended' | 'ntnyq/vue/ts__ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/userscript';
12316
12318
 
12317
12319
  /**
12318
12320
  * Typed flat config item
@@ -12368,6 +12370,15 @@ interface ConfigPrettierOptions extends OptionsOverrides {
12368
12370
  * @default 'warn'
12369
12371
  */
12370
12372
  level?: 'warn' | 'error';
12373
+ /**
12374
+ * Glob of built-in disabled files
12375
+ */
12376
+ disabledFiles?: string[];
12377
+ /**
12378
+ * Glob of user custom disabled files
12379
+ * @default []
12380
+ */
12381
+ userDisabledFiles?: string[];
12371
12382
  }
12372
12383
  type PerfectionistSortType = 'alphabetical' | 'line-length' | 'natural';
12373
12384
  type PerfectionistSortOrder = 'asc' | 'desc';
@@ -12392,6 +12403,12 @@ interface ConfigPerfectionistOptions extends OptionsOverrides {
12392
12403
  interface ConfigCommentsOptions extends OptionsOverrides {
12393
12404
  }
12394
12405
  interface ConfigRegexpOptions extends OptionsOverrides {
12406
+ /**
12407
+ * Prettier level
12408
+ *
12409
+ * @default 'error'
12410
+ */
12411
+ level?: 'warn' | 'error';
12395
12412
  }
12396
12413
  interface ConfigJavaScriptOptions extends OptionsOverrides {
12397
12414
  /**
@@ -12576,6 +12593,11 @@ declare const jsonc: (options?: ConfigJsoncOptions) => TypedConfigItem[];
12576
12593
 
12577
12594
  declare const ntnyq: (options?: ConfigNtnyqOptions) => TypedConfigItem[];
12578
12595
 
12596
+ /**
12597
+ * @file config for plugin regexp
12598
+ * @see {@link https://github.com/ota-meshi/eslint-plugin-regexp}
12599
+ */
12600
+
12579
12601
  declare const regexp: (options?: ConfigRegexpOptions) => TypedConfigItem[];
12580
12602
 
12581
12603
  declare const unocss: (options?: ConfigUnoCSSOptions) => TypedConfigItem[];
package/dist/index.d.ts CHANGED
@@ -1442,6 +1442,7 @@ interface RuleOptions {
1442
1442
  */
1443
1443
  'jsdoc/no-missing-syntax'?: Linter.RuleEntry<JsdocNoMissingSyntax>;
1444
1444
  /**
1445
+ * Prevents use of multiple asterisks at the beginning of lines.
1445
1446
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-multi-asterisks.md#repos-sticky-header
1446
1447
  */
1447
1448
  'jsdoc/no-multi-asterisks'?: Linter.RuleEntry<JsdocNoMultiAsterisks>;
@@ -1586,6 +1587,7 @@ interface RuleOptions {
1586
1587
  */
1587
1588
  'jsdoc/tag-lines'?: Linter.RuleEntry<JsdocTagLines>;
1588
1589
  /**
1590
+ * Auto-escape certain characters that are input within block and tag descriptions.
1589
1591
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md#repos-sticky-header
1590
1592
  */
1591
1593
  'jsdoc/text-escaping'?: Linter.RuleEntry<JsdocTextEscaping>;
@@ -12312,7 +12314,7 @@ type Yoda = [] | [("always" | "never")] | [
12312
12314
  onlyEquality?: boolean;
12313
12315
  }
12314
12316
  ];
12315
- type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/userscript';
12317
+ type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'ntnyq/ts/core__typescript-eslint/base' | 'ntnyq/ts/core__typescript-eslint/eslint-recommended' | 'ntnyq/ts/core__typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/vue/ts__ntnyq/ts/core__typescript-eslint/base' | 'ntnyq/vue/ts__ntnyq/ts/core__typescript-eslint/eslint-recommended' | 'ntnyq/vue/ts__ntnyq/ts/core__typescript-eslint/recommended' | 'ntnyq/vue/ts__ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/userscript';
12316
12318
 
12317
12319
  /**
12318
12320
  * Typed flat config item
@@ -12368,6 +12370,15 @@ interface ConfigPrettierOptions extends OptionsOverrides {
12368
12370
  * @default 'warn'
12369
12371
  */
12370
12372
  level?: 'warn' | 'error';
12373
+ /**
12374
+ * Glob of built-in disabled files
12375
+ */
12376
+ disabledFiles?: string[];
12377
+ /**
12378
+ * Glob of user custom disabled files
12379
+ * @default []
12380
+ */
12381
+ userDisabledFiles?: string[];
12371
12382
  }
12372
12383
  type PerfectionistSortType = 'alphabetical' | 'line-length' | 'natural';
12373
12384
  type PerfectionistSortOrder = 'asc' | 'desc';
@@ -12392,6 +12403,12 @@ interface ConfigPerfectionistOptions extends OptionsOverrides {
12392
12403
  interface ConfigCommentsOptions extends OptionsOverrides {
12393
12404
  }
12394
12405
  interface ConfigRegexpOptions extends OptionsOverrides {
12406
+ /**
12407
+ * Prettier level
12408
+ *
12409
+ * @default 'error'
12410
+ */
12411
+ level?: 'warn' | 'error';
12395
12412
  }
12396
12413
  interface ConfigJavaScriptOptions extends OptionsOverrides {
12397
12414
  /**
@@ -12576,6 +12593,11 @@ declare const jsonc: (options?: ConfigJsoncOptions) => TypedConfigItem[];
12576
12593
 
12577
12594
  declare const ntnyq: (options?: ConfigNtnyqOptions) => TypedConfigItem[];
12578
12595
 
12596
+ /**
12597
+ * @file config for plugin regexp
12598
+ * @see {@link https://github.com/ota-meshi/eslint-plugin-regexp}
12599
+ */
12600
+
12579
12601
  declare const regexp: (options?: ConfigRegexpOptions) => TypedConfigItem[];
12580
12602
 
12581
12603
  declare const unocss: (options?: ConfigUnoCSSOptions) => TypedConfigItem[];
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",
@@ -992,17 +988,30 @@ var ntnyq = (options = {}) => [
992
988
  ];
993
989
 
994
990
  // src/configs/regexp.ts
995
- var regexp = (options = {}) => [
996
- /**
997
- * https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/rules/recommended.ts
998
- */
999
- {
1000
- name: "ntnyq/regexp",
1001
- ...pluginRegexp.configs["flat/recommended"],
1002
- // Overrides rules
1003
- ...options.overrides
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
+ }
1004
1002
  }
1005
- ];
1003
+ return [
1004
+ {
1005
+ ...config,
1006
+ name: "ntnyq/regexp",
1007
+ rules: {
1008
+ ...rules,
1009
+ // Overrides rules
1010
+ ...options.overrides
1011
+ }
1012
+ }
1013
+ ];
1014
+ };
1006
1015
 
1007
1016
  // src/configs/unocss.ts
1008
1017
  var unocss = (options = {}) => [
@@ -1251,70 +1260,76 @@ var markdown = (options = {}) => {
1251
1260
  };
1252
1261
 
1253
1262
  // src/configs/prettier.ts
1254
- var prettier = (options = {}) => [
1255
- {
1256
- name: "ntnyq/prettier",
1257
- plugins: {
1258
- prettier: default15
1259
- },
1260
- rules: {
1261
- "vue/array-bracket-newline": "off",
1262
- "vue/array-bracket-spacing": "off",
1263
- "vue/array-element-newline": "off",
1264
- "vue/arrow-spacing": "off",
1265
- "vue/block-spacing": "off",
1266
- "vue/block-tag-newline": "off",
1267
- "vue/brace-style": "off",
1268
- "vue/comma-dangle": "off",
1269
- "vue/comma-spacing": "off",
1270
- "vue/comma-style": "off",
1271
- "vue/dot-location": "off",
1272
- "vue/func-call-spacing": "off",
1273
- "vue/html-closing-bracket-newline": "off",
1274
- "vue/html-closing-bracket-spacing": "off",
1275
- "vue/html-end-tags": "off",
1276
- "vue/html-indent": "off",
1277
- "vue/html-quotes": "off",
1278
- "vue/key-spacing": "off",
1279
- "vue/keyword-spacing": "off",
1280
- "vue/max-attributes-per-line": "off",
1281
- "vue/multiline-html-element-content-newline": "off",
1282
- "vue/multiline-ternary": "off",
1283
- "vue/mustache-interpolation-spacing": "off",
1284
- "vue/no-extra-parens": "off",
1285
- "vue/no-multi-spaces": "off",
1286
- "vue/no-spaces-around-equal-signs-in-attribute": "off",
1287
- "vue/object-curly-newline": "off",
1288
- "vue/object-curly-spacing": "off",
1289
- "vue/object-property-newline": "off",
1290
- "vue/operator-linebreak": "off",
1291
- "vue/quote-props": "off",
1292
- "vue/script-indent": "off",
1293
- "vue/singleline-html-element-content-newline": "off",
1294
- "vue/space-in-parens": "off",
1295
- "vue/space-infix-ops": "off",
1296
- "vue/space-unary-ops": "off",
1297
- "vue/template-curly-spacing": "off",
1298
- ...default15.configs.recommended.rules,
1299
- "prettier/prettier": options.level || "warn",
1300
- // Overrides rules
1301
- ...options.overrides
1302
- }
1303
- },
1304
- /**
1305
- * Languages that prettier currently does not support
1306
- */
1307
- {
1308
- name: "ntnyq/prettier/disabled",
1309
- files: [GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
1310
- plugins: {
1311
- 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
+ }
1312
1317
  },
1313
- rules: {
1314
- "prettier/prettier": "off"
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
+ }
1315
1330
  }
1316
- }
1317
- ];
1331
+ ];
1332
+ };
1318
1333
 
1319
1334
  // src/configs/gitignore.ts
1320
1335
  import createGitIgnoreConfig from "eslint-config-flat-gitignore";
@@ -1758,6 +1773,7 @@ function defineESLintConfig(options = {}, userConfigs = []) {
1758
1773
  if (options.regexp ?? true) {
1759
1774
  configs.push(
1760
1775
  ...regexp({
1776
+ ...resolveSubOptions(options, "regexp"),
1761
1777
  overrides: getOverrides(options, "regexp")
1762
1778
  })
1763
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.2",
5
- "packageManager": "pnpm@9.12.1",
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.0",
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.4.1",
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.9.0",
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.9.0",
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.5",
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.3",
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",