@ncontiero/eslint-config 8.1.0 → 8.2.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 CHANGED
@@ -16707,6 +16707,12 @@ interface OptionsConfig {
16707
16707
  * @default true
16708
16708
  */
16709
16709
  unicorn?: boolean | OptionsUnicorn;
16710
+ /**
16711
+ * Options for eslint-plugin-perfectionist.
16712
+ *
16713
+ * @default true
16714
+ */
16715
+ perfectionist?: boolean | OptionsOverrides;
16710
16716
  /**
16711
16717
  * Options for [@e18e/eslint-plugin](https://github.com/e18e/eslint-plugin)
16712
16718
  *
@@ -16843,7 +16849,7 @@ declare function node(): FlatConfigItem[];
16843
16849
  *
16844
16850
  * @see https://github.com/azat-io/eslint-plugin-perfectionist
16845
16851
  */
16846
- declare function perfectionist(): FlatConfigItem[];
16852
+ declare function perfectionist(options?: OptionsOverrides): FlatConfigItem[];
16847
16853
  //#endregion
16848
16854
  //#region src/configs/prettier.d.ts
16849
16855
  declare function prettier(options?: PrettierOptions): Promise<FlatConfigItem[]>;
package/dist/index.mjs CHANGED
@@ -465,7 +465,7 @@ function javascript(options = {}) {
465
465
  "no-useless-escape": "error",
466
466
  "no-useless-rename": "error",
467
467
  "no-var": "error",
468
- "no-void": "error",
468
+ "no-void": ["error", { allowAsStatement: true }],
469
469
  "no-with": "error",
470
470
  "object-shorthand": [
471
471
  "error",
@@ -785,7 +785,8 @@ function node() {
785
785
  *
786
786
  * @see https://github.com/azat-io/eslint-plugin-perfectionist
787
787
  */
788
- function perfectionist() {
788
+ function perfectionist(options = {}) {
789
+ const { overrides = {} } = options;
789
790
  return [{
790
791
  name: "ncontiero/perfectionist/rules",
791
792
  plugins: { perfectionist: pluginPerfectionist },
@@ -823,7 +824,8 @@ function perfectionist() {
823
824
  type: "natural"
824
825
  }],
825
826
  "perfectionist/sort-named-exports": ["warn", { groups: ["type-export", "value-export"] }],
826
- "perfectionist/sort-named-imports": ["warn", { groups: ["type-import", "value-import"] }]
827
+ "perfectionist/sort-named-imports": ["warn", { groups: ["type-import", "value-import"] }],
828
+ ...overrides
827
829
  }
828
830
  }];
829
831
  }
@@ -1387,7 +1389,7 @@ async function typescript(options = {}) {
1387
1389
  "ts/no-floating-promises": "error",
1388
1390
  "ts/no-for-in-array": "error",
1389
1391
  "ts/no-implied-eval": "error",
1390
- "ts/no-misused-promises": "error",
1392
+ "ts/no-misused-promises": ["error", { checksVoidReturn: { attributes: false } }],
1391
1393
  "ts/no-unnecessary-type-arguments": "error",
1392
1394
  "ts/no-unnecessary-type-assertion": "error",
1393
1395
  "ts/no-unsafe-argument": "error",
@@ -1402,7 +1404,10 @@ async function typescript(options = {}) {
1402
1404
  "ts/restrict-plus-operands": "error",
1403
1405
  "ts/restrict-template-expressions": "error",
1404
1406
  "ts/return-await": ["error", "always"],
1405
- "ts/strict-boolean-expressions": ["error", { allowNullableBoolean: true }],
1407
+ "ts/strict-boolean-expressions": ["error", {
1408
+ allowNullableBoolean: true,
1409
+ allowNullableString: true
1410
+ }],
1406
1411
  "ts/switch-exhaustiveness-check": ["error", { considerDefaultExhaustiveForUnions: true }],
1407
1412
  "ts/unbound-method": "error"
1408
1413
  };
@@ -1720,7 +1725,7 @@ function getStyleOptions(options) {
1720
1725
  * @returns Merged ESLint configurations based on provided options.
1721
1726
  */
1722
1727
  function ncontiero(options = {}, ...userConfigs) {
1723
- const { deMorgan: enableDeMorgan = true, e18e: enableE18e = true, gitignore: enableGitignore = true, html: enableHtml = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJsdoc = true, jsonc: enableJsonc = true, jsx: enableJsx = true, markdown: enableMarkdown = true, nextjs: enableNextJs = hasNextJs, node: enableNode = true, prettier: enablePrettier = true, promise: enablePromise = true, react: enableReact = hasReact, regexp: enableRegexp = true, tailwindcss: enableTailwindCSS = hasTailwind, tanstackQuery: enableTanStackQuery = false, typescript: enableTypescript = hasTypeScript, unicorn: enableUnicorn = true } = options;
1728
+ const { deMorgan: enableDeMorgan = true, e18e: enableE18e = true, gitignore: enableGitignore = true, html: enableHtml = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJsdoc = true, jsonc: enableJsonc = true, jsx: enableJsx = true, markdown: enableMarkdown = true, nextjs: enableNextJs = hasNextJs, node: enableNode = true, perfectionist: enablePerfectionist = true, prettier: enablePrettier = true, promise: enablePromise = true, react: enableReact = hasReact, regexp: enableRegexp = true, tailwindcss: enableTailwindCSS = hasTailwind, tanstackQuery: enableTanStackQuery = false, typescript: enableTypescript = hasTypeScript, unicorn: enableUnicorn = true } = options;
1724
1729
  const prettierOptions = typeof options.prettier === "object" ? options.prettier : {};
1725
1730
  const styleOptions = getStyleOptions(prettierOptions);
1726
1731
  const configs = [];
@@ -1734,7 +1739,8 @@ function ncontiero(options = {}, ...userConfigs) {
1734
1739
  })]));
1735
1740
  const typescriptOptions = resolveSubOptions(options, "typescript");
1736
1741
  const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
1737
- configs.push(ignores(userIgnores, !enableTypescript), javascript({ overrides: getOverrides(options, "javascript") }), comments(), command(), perfectionist());
1742
+ configs.push(ignores(userIgnores, !enableTypescript), javascript({ overrides: getOverrides(options, "javascript") }), comments(), command());
1743
+ if (enablePerfectionist) configs.push(perfectionist({ overrides: getOverrides(options, "perfectionist") }));
1738
1744
  if (enableNode) configs.push(node());
1739
1745
  if (enablePromise) configs.push(promise({ overrides: getOverrides(options, "promise") }));
1740
1746
  if (enableJsdoc) configs.push(jsdoc());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ncontiero/eslint-config",
3
3
  "type": "module",
4
- "version": "8.1.0",
4
+ "version": "8.2.0",
5
5
  "description": "Nicolas's ESLint config.",
6
6
  "author": {
7
7
  "name": "Nicolas Contiero",
@@ -39,13 +39,13 @@
39
39
  "dependencies": {
40
40
  "@e18e/eslint-plugin": "^0.4.1",
41
41
  "@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
42
- "@eslint-react/eslint-plugin": "^5.7.5",
42
+ "@eslint-react/eslint-plugin": "^5.7.6",
43
43
  "@eslint/markdown": "^8.0.1",
44
44
  "@html-eslint/eslint-plugin": "^0.60.0",
45
45
  "@html-eslint/parser": "^0.60.0",
46
46
  "@next/eslint-plugin-next": "^16.2.6",
47
- "@typescript-eslint/eslint-plugin": "^8.59.2",
48
- "@typescript-eslint/parser": "^8.59.2",
47
+ "@typescript-eslint/eslint-plugin": "^8.59.3",
48
+ "@typescript-eslint/parser": "^8.59.3",
49
49
  "eslint-config-flat-gitignore": "^2.3.0",
50
50
  "eslint-merge-processors": "^2.0.0",
51
51
  "eslint-plugin-antfu": "^3.2.3",
@@ -81,7 +81,7 @@
81
81
  "@ncontiero/prettier-config": "^1.0.0",
82
82
  "@tanstack/eslint-plugin-query": "^5.100.10",
83
83
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
84
- "@types/node": "^25.6.2",
84
+ "@types/node": "^25.7.0",
85
85
  "eslint": "^10.3.0",
86
86
  "eslint-typegen": "^2.3.1",
87
87
  "husky": "^9.1.7",