@ntnyq/eslint-config 3.1.0 → 3.1.1

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
@@ -11,6 +11,7 @@
11
11
 
12
12
  - Opinionable: single quotes, no semi
13
13
  - Designed to work alongside with [Prettier](https://prettier.io)
14
+ - Respect `.gitignore` via [eslint-config-flat-gitignore](https://github.com/antfu/eslint-config-flat-gitignore)
14
15
  - Out-of-box support for TypeScript, Vue, JSON, Markdown, YAML, etc.
15
16
  - [ESLint flat config](https://eslint.org/docs/latest/use/configure/configuration-files) for ESLint v9.5.0+
16
17
 
package/dist/index.cjs CHANGED
@@ -935,6 +935,21 @@ var sort = (options = {}) => {
935
935
  }
936
936
  );
937
937
  }
938
+ if (options.pnpmWorkspace ?? true) {
939
+ configs.push({
940
+ name: "ntnyq/sort/pnpm-workspace",
941
+ files: ["**/pnpm-workspace.yaml"],
942
+ rules: {
943
+ "yml/sort-keys": [
944
+ "error",
945
+ {
946
+ pathPattern: ".*",
947
+ order: { type: "asc" }
948
+ }
949
+ ]
950
+ }
951
+ });
952
+ }
938
953
  return configs;
939
954
  };
940
955
 
@@ -1458,12 +1473,15 @@ var prettier = (options = {}) => {
1458
1473
 
1459
1474
  // src/configs/gitignore.ts
1460
1475
  var import_eslint_config_flat_gitignore = __toESM(require("eslint-config-flat-gitignore"), 1);
1461
- var gitignore = (options = {}) => [
1462
- {
1463
- ...(0, import_eslint_config_flat_gitignore.default)(options),
1464
- name: "ntnyq/gitignore"
1465
- }
1466
- ];
1476
+ var gitignore = (options = {}) => {
1477
+ options.strict ??= false;
1478
+ return [
1479
+ {
1480
+ ...(0, import_eslint_config_flat_gitignore.default)(options),
1481
+ name: "ntnyq/gitignore"
1482
+ }
1483
+ ];
1484
+ };
1467
1485
 
1468
1486
  // src/configs/javascript.ts
1469
1487
  var import_js = __toESM(require("@eslint/js"), 1);
package/dist/index.d.cts CHANGED
@@ -226,7 +226,7 @@ interface RuleOptions {
226
226
  */
227
227
  '@typescript-eslint/no-array-delete'?: Linter.RuleEntry<[]>;
228
228
  /**
229
- * Require `.toString()` to only be called on objects which provide useful information when stringified
229
+ * Require `.toString()` and `.toLocaleString()` to only be called on objects which provide useful information when stringified
230
230
  * @see https://typescript-eslint.io/rules/no-base-to-string
231
231
  */
232
232
  '@typescript-eslint/no-base-to-string'?: Linter.RuleEntry<TypescriptEslintNoBaseToString>;
@@ -12314,7 +12314,7 @@ type Yoda = [] | [("always" | "never")] | [
12314
12314
  onlyEquality?: boolean;
12315
12315
  }
12316
12316
  ];
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';
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/sort/pnpm-workspace' | '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';
12318
12318
 
12319
12319
  /**
12320
12320
  * Typed flat config item
@@ -12347,7 +12347,14 @@ interface OptionsOverrides<Rules extends TypedConfigItem['rules'] = TypedConfigI
12347
12347
  overrides?: Rules;
12348
12348
  }
12349
12349
  type ConfigIgnoresOptions = string[];
12350
- type ConfigGitIgnoreOptions = FlatGitignoreOptions;
12350
+ type ConfigGitIgnoreOptions = Omit<FlatGitignoreOptions, 'strict'> & {
12351
+ /**
12352
+ * Throw an error if gitignore file not found.
12353
+ *
12354
+ * @default false
12355
+ */
12356
+ strict?: boolean;
12357
+ };
12351
12358
  type ConfigCommandOptions = ESLintPluginCommandOptions;
12352
12359
  interface ConfigJsdocOptions extends OptionsOverrides {
12353
12360
  }
@@ -12441,6 +12448,10 @@ interface ConfigSortOptions {
12441
12448
  * @default true
12442
12449
  */
12443
12450
  i18nLocale?: boolean;
12451
+ /**
12452
+ * @default true
12453
+ */
12454
+ pnpmWorkspace?: boolean;
12444
12455
  }
12445
12456
  interface ConfigJsoncOptions extends OptionsOverrides {
12446
12457
  }
package/dist/index.d.ts CHANGED
@@ -226,7 +226,7 @@ interface RuleOptions {
226
226
  */
227
227
  '@typescript-eslint/no-array-delete'?: Linter.RuleEntry<[]>;
228
228
  /**
229
- * Require `.toString()` to only be called on objects which provide useful information when stringified
229
+ * Require `.toString()` and `.toLocaleString()` to only be called on objects which provide useful information when stringified
230
230
  * @see https://typescript-eslint.io/rules/no-base-to-string
231
231
  */
232
232
  '@typescript-eslint/no-base-to-string'?: Linter.RuleEntry<TypescriptEslintNoBaseToString>;
@@ -12314,7 +12314,7 @@ type Yoda = [] | [("always" | "never")] | [
12314
12314
  onlyEquality?: boolean;
12315
12315
  }
12316
12316
  ];
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';
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/sort/pnpm-workspace' | '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';
12318
12318
 
12319
12319
  /**
12320
12320
  * Typed flat config item
@@ -12347,7 +12347,14 @@ interface OptionsOverrides<Rules extends TypedConfigItem['rules'] = TypedConfigI
12347
12347
  overrides?: Rules;
12348
12348
  }
12349
12349
  type ConfigIgnoresOptions = string[];
12350
- type ConfigGitIgnoreOptions = FlatGitignoreOptions;
12350
+ type ConfigGitIgnoreOptions = Omit<FlatGitignoreOptions, 'strict'> & {
12351
+ /**
12352
+ * Throw an error if gitignore file not found.
12353
+ *
12354
+ * @default false
12355
+ */
12356
+ strict?: boolean;
12357
+ };
12351
12358
  type ConfigCommandOptions = ESLintPluginCommandOptions;
12352
12359
  interface ConfigJsdocOptions extends OptionsOverrides {
12353
12360
  }
@@ -12441,6 +12448,10 @@ interface ConfigSortOptions {
12441
12448
  * @default true
12442
12449
  */
12443
12450
  i18nLocale?: boolean;
12451
+ /**
12452
+ * @default true
12453
+ */
12454
+ pnpmWorkspace?: boolean;
12444
12455
  }
12445
12456
  interface ConfigJsoncOptions extends OptionsOverrides {
12446
12457
  }
package/dist/index.js CHANGED
@@ -810,6 +810,21 @@ var sort = (options = {}) => {
810
810
  }
811
811
  );
812
812
  }
813
+ if (options.pnpmWorkspace ?? true) {
814
+ configs.push({
815
+ name: "ntnyq/sort/pnpm-workspace",
816
+ files: ["**/pnpm-workspace.yaml"],
817
+ rules: {
818
+ "yml/sort-keys": [
819
+ "error",
820
+ {
821
+ pathPattern: ".*",
822
+ order: { type: "asc" }
823
+ }
824
+ ]
825
+ }
826
+ });
827
+ }
813
828
  return configs;
814
829
  };
815
830
 
@@ -1333,12 +1348,15 @@ var prettier = (options = {}) => {
1333
1348
 
1334
1349
  // src/configs/gitignore.ts
1335
1350
  import createGitIgnoreConfig from "eslint-config-flat-gitignore";
1336
- var gitignore = (options = {}) => [
1337
- {
1338
- ...createGitIgnoreConfig(options),
1339
- name: "ntnyq/gitignore"
1340
- }
1341
- ];
1351
+ var gitignore = (options = {}) => {
1352
+ options.strict ??= false;
1353
+ return [
1354
+ {
1355
+ ...createGitIgnoreConfig(options),
1356
+ name: "ntnyq/gitignore"
1357
+ }
1358
+ ];
1359
+ };
1342
1360
 
1343
1361
  // src/configs/javascript.ts
1344
1362
  import jsConfig from "@eslint/js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "3.1.0",
4
+ "version": "3.1.1",
5
5
  "packageManager": "pnpm@9.12.2",
6
6
  "description": "An opinionated ESLint config preset of ntnyq",
7
7
  "keywords": [
@@ -56,10 +56,10 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
59
- "@eslint/js": "^9.12.0",
59
+ "@eslint/js": "^9.13.0",
60
60
  "@eslint/markdown": "^6.2.1",
61
61
  "@types/eslint__js": "^8.42.3",
62
- "@unocss/eslint-plugin": "^0.63.4",
62
+ "@unocss/eslint-plugin": "^0.63.6",
63
63
  "@vitest/eslint-plugin": "^1.1.7",
64
64
  "eslint-config-flat-gitignore": "^0.3.0",
65
65
  "eslint-flat-config-utils": "^0.4.0",
@@ -77,27 +77,27 @@
77
77
  "eslint-plugin-toml": "^0.11.1",
78
78
  "eslint-plugin-unicorn": "^56.0.0",
79
79
  "eslint-plugin-unused-imports": "^4.1.4",
80
- "eslint-plugin-vue": "^9.29.0",
80
+ "eslint-plugin-vue": "^9.29.1",
81
81
  "eslint-plugin-yml": "^1.14.0",
82
82
  "globals": "^15.11.0",
83
83
  "jsonc-eslint-parser": "^2.4.0",
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.10.0",
87
+ "typescript-eslint": "^8.11.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.6",
93
+ "@types/node": "^22.7.8",
94
94
  "bumpp": "^9.7.1",
95
- "eslint": "^9.12.0",
95
+ "eslint": "^9.13.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.4",
100
+ "npm-run-all2": "^7.0.0",
101
101
  "rimraf": "^6.0.1",
102
102
  "tsup": "^8.3.0",
103
103
  "tsx": "^4.19.1",