@ntnyq/eslint-config 3.10.3 → 3.10.4

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.cjs CHANGED
@@ -1133,20 +1133,24 @@ var test = (options = {}) => [
1133
1133
  }
1134
1134
  }
1135
1135
  ];
1136
- var vitest = (options = {}) => [
1137
- {
1138
- name: "ntnyq/vitest",
1139
- plugins: {
1140
- vitest: import_eslint_plugin2.default
1141
- },
1142
- files: [...GLOB_TEST],
1143
- rules: {
1144
- ...import_eslint_plugin2.default.configs.recommended.rules,
1145
- // Overrides rules
1146
- ...options.overridesVitestRules
1136
+ var vitest = (options = {}) => {
1137
+ if (!import_eslint_plugin2.default.configs?.recommended) return [];
1138
+ const vitestConfigs = import_eslint_plugin2.default.configs;
1139
+ return [
1140
+ {
1141
+ name: "ntnyq/vitest",
1142
+ plugins: {
1143
+ vitest: import_eslint_plugin2.default
1144
+ },
1145
+ files: [...GLOB_TEST],
1146
+ rules: {
1147
+ ...vitestConfigs.recommended.rules,
1148
+ // Overrides rules
1149
+ ...options.overridesVitestRules
1150
+ }
1147
1151
  }
1148
- }
1149
- ];
1152
+ ];
1153
+ };
1150
1154
 
1151
1155
  // src/configs/svgo.ts
1152
1156
  var import_eslint_plugin_svgo2 = require("eslint-plugin-svgo");
@@ -2084,12 +2088,27 @@ var comments = (options = {}) => [
2084
2088
  // src/configs/markdown.ts
2085
2089
  var markdown = (options = {}) => {
2086
2090
  if (!Array.isArray(import_markdown.default.configs?.processor)) return [];
2087
- const { files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`], extensions = [] } = options;
2091
+ const {
2092
+ /**
2093
+ * code block files
2094
+ */
2095
+ files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`],
2096
+ /**
2097
+ * other extensions
2098
+ */
2099
+ extensions = []
2100
+ } = options;
2088
2101
  return [
2102
+ /**
2103
+ * extracting code blocks to be linted individually
2104
+ */
2089
2105
  ...import_markdown.default.configs.processor.map((config) => ({
2090
2106
  ...config,
2091
2107
  name: `ntnyq/${config.name}`
2092
2108
  })),
2109
+ /**
2110
+ * enhance `markdown/recommended/processor`
2111
+ */
2093
2112
  {
2094
2113
  name: "ntnyq/markdown/processor",
2095
2114
  files,
@@ -2575,8 +2594,10 @@ var typescript = (options = {}) => {
2575
2594
  ...recommendedRules,
2576
2595
  // Disabled in favor of ts rules
2577
2596
  "no-redeclare": "off",
2578
- "no-use-before-define": "off",
2579
2597
  "no-unused-vars": "off",
2598
+ "no-use-before-define": "off",
2599
+ "no-useless-constructor": "off",
2600
+ "@typescript-eslint/no-useless-constructor": "error",
2580
2601
  "@typescript-eslint/no-redeclare": [
2581
2602
  "error",
2582
2603
  {
package/dist/index.d.cts CHANGED
@@ -5099,6 +5099,11 @@ interface RuleOptions {
5099
5099
  * @deprecated
5100
5100
  */
5101
5101
  'nonblock-statement-body-position'?: Linter.RuleEntry<NonblockStatementBodyPosition>;
5102
+ /**
5103
+ * disallow duplicate exports statement
5104
+ * @see https://eslint-plugin.ntnyq.com/rules/no-duplicate-exports.html
5105
+ */
5106
+ 'ntnyq/no-duplicate-exports'?: Linter.RuleEntry<NtnyqNoDuplicateExports>;
5102
5107
  /**
5103
5108
  * disallow usage of typescript member accessibility
5104
5109
  * @see https://eslint-plugin.ntnyq.com/rules/no-member-accessibility.html
@@ -14157,6 +14162,11 @@ type NonblockStatementBodyPosition = [] | [("beside" | "below" | "any")] | [
14157
14162
  };
14158
14163
  }
14159
14164
  ];
14165
+ type NtnyqNoDuplicateExports = [] | [
14166
+ {
14167
+ style?: ("inline" | "separate");
14168
+ }
14169
+ ];
14160
14170
  type ObjectCurlyNewline = [] | [
14161
14171
  ((("always" | "never") | {
14162
14172
  multiline?: boolean;
package/dist/index.d.ts CHANGED
@@ -5099,6 +5099,11 @@ interface RuleOptions {
5099
5099
  * @deprecated
5100
5100
  */
5101
5101
  'nonblock-statement-body-position'?: Linter.RuleEntry<NonblockStatementBodyPosition>;
5102
+ /**
5103
+ * disallow duplicate exports statement
5104
+ * @see https://eslint-plugin.ntnyq.com/rules/no-duplicate-exports.html
5105
+ */
5106
+ 'ntnyq/no-duplicate-exports'?: Linter.RuleEntry<NtnyqNoDuplicateExports>;
5102
5107
  /**
5103
5108
  * disallow usage of typescript member accessibility
5104
5109
  * @see https://eslint-plugin.ntnyq.com/rules/no-member-accessibility.html
@@ -14157,6 +14162,11 @@ type NonblockStatementBodyPosition = [] | [("beside" | "below" | "any")] | [
14157
14162
  };
14158
14163
  }
14159
14164
  ];
14165
+ type NtnyqNoDuplicateExports = [] | [
14166
+ {
14167
+ style?: ("inline" | "separate");
14168
+ }
14169
+ ];
14160
14170
  type ObjectCurlyNewline = [] | [
14161
14171
  ((("always" | "never") | {
14162
14172
  multiline?: boolean;
package/dist/index.js CHANGED
@@ -977,20 +977,24 @@ var test = (options = {}) => [
977
977
  }
978
978
  }
979
979
  ];
980
- var vitest = (options = {}) => [
981
- {
982
- name: "ntnyq/vitest",
983
- plugins: {
984
- vitest: default16
985
- },
986
- files: [...GLOB_TEST],
987
- rules: {
988
- ...default16.configs.recommended.rules,
989
- // Overrides rules
990
- ...options.overridesVitestRules
980
+ var vitest = (options = {}) => {
981
+ if (!default16.configs?.recommended) return [];
982
+ const vitestConfigs = default16.configs;
983
+ return [
984
+ {
985
+ name: "ntnyq/vitest",
986
+ plugins: {
987
+ vitest: default16
988
+ },
989
+ files: [...GLOB_TEST],
990
+ rules: {
991
+ ...vitestConfigs.recommended.rules,
992
+ // Overrides rules
993
+ ...options.overridesVitestRules
994
+ }
991
995
  }
992
- }
993
- ];
996
+ ];
997
+ };
994
998
 
995
999
  // src/configs/svgo.ts
996
1000
  import { config as createSVGOConfig } from "eslint-plugin-svgo";
@@ -1928,12 +1932,27 @@ var comments = (options = {}) => [
1928
1932
  // src/configs/markdown.ts
1929
1933
  var markdown = (options = {}) => {
1930
1934
  if (!Array.isArray(default10.configs?.processor)) return [];
1931
- const { files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`], extensions = [] } = options;
1935
+ const {
1936
+ /**
1937
+ * code block files
1938
+ */
1939
+ files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`],
1940
+ /**
1941
+ * other extensions
1942
+ */
1943
+ extensions = []
1944
+ } = options;
1932
1945
  return [
1946
+ /**
1947
+ * extracting code blocks to be linted individually
1948
+ */
1933
1949
  ...default10.configs.processor.map((config) => ({
1934
1950
  ...config,
1935
1951
  name: `ntnyq/${config.name}`
1936
1952
  })),
1953
+ /**
1954
+ * enhance `markdown/recommended/processor`
1955
+ */
1937
1956
  {
1938
1957
  name: "ntnyq/markdown/processor",
1939
1958
  files,
@@ -2419,8 +2438,10 @@ var typescript = (options = {}) => {
2419
2438
  ...recommendedRules,
2420
2439
  // Disabled in favor of ts rules
2421
2440
  "no-redeclare": "off",
2422
- "no-use-before-define": "off",
2423
2441
  "no-unused-vars": "off",
2442
+ "no-use-before-define": "off",
2443
+ "no-useless-constructor": "off",
2444
+ "@typescript-eslint/no-useless-constructor": "error",
2424
2445
  "@typescript-eslint/no-redeclare": [
2425
2446
  "error",
2426
2447
  {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "3.10.3",
5
- "packageManager": "pnpm@9.15.1",
4
+ "version": "3.10.4",
5
+ "packageManager": "pnpm@9.15.2",
6
6
  "description": "An opinionated ESLint config preset of ntnyq",
7
7
  "keywords": [
8
8
  "eslint",
@@ -60,7 +60,7 @@
60
60
  "@eslint/markdown": "^6.2.1",
61
61
  "@stylistic/eslint-plugin": "^2.12.1",
62
62
  "@unocss/eslint-plugin": "^0.65.3",
63
- "@vitest/eslint-plugin": "^1.1.20",
63
+ "@vitest/eslint-plugin": "^1.1.21",
64
64
  "eslint-config-flat-gitignore": "^0.3.0",
65
65
  "eslint-flat-config-utils": "^0.4.0",
66
66
  "eslint-import-resolver-typescript": "^3.7.0",
@@ -75,7 +75,7 @@
75
75
  "eslint-plugin-jsdoc": "^50.6.1",
76
76
  "eslint-plugin-jsonc": "^2.18.2",
77
77
  "eslint-plugin-n": "^17.15.1",
78
- "eslint-plugin-ntnyq": "^0.7.1",
78
+ "eslint-plugin-ntnyq": "^0.8.2",
79
79
  "eslint-plugin-perfectionist": "^4.4.0",
80
80
  "eslint-plugin-pinia": "^0.4.1",
81
81
  "eslint-plugin-prettier": "^5.2.1",