@ntnyq/eslint-config 7.0.0-beta.16 → 7.0.0-beta.18

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
@@ -8,7 +8,7 @@
8
8
  [![NPM DOWNLOADS](https://img.shields.io/npm/dy/@ntnyq/eslint-config)](https://www.npmjs.com/package/@ntnyq/eslint-config)
9
9
  [![LICENSE](https://img.shields.io/github/license/ntnyq/eslint-config.svg)](https://github.com/ntnyq/eslint-config/blob/main/LICENSE)
10
10
 
11
- ## Requirements
11
+ ## 📋 Requirements
12
12
 
13
13
  - Node.js ^22.23.0 || >=24.15.0
14
14
  - ESLint ^10.4.0
@@ -20,15 +20,15 @@
20
20
  > - Node.js < 20.19.0: use [v5](https://github.com/ntnyq/eslint-config/tree/v5)
21
21
  > - Node.js < 22.23.0: use [v6](https://github.com/ntnyq/eslint-config/tree/v6)
22
22
 
23
- ## Why Frontend Teams Use It
23
+ ## ✨ Features
24
24
 
25
- - Works out of the box with ESLint flat config.
26
- - Auto-detects and enables configs by your dependencies and file types.
27
- - Covers common frontend files: TS, Vue SFC, JSON, Markdown, YAML, TOML.
28
- - Keeps formatting tool friendly (Prettier or oxfmt).
29
- - Supports scaling from single apps to monorepos.
25
+ - 🚀 Works out of the box with ESLint flat config.
26
+ - 🔍 Auto-detects and enables configs by your dependencies and file types.
27
+ - 🧩 Covers common frontend files: TS, Vue SFC, JSON, Markdown, YAML, TOML.
28
+ - 🎨 Keeps formatting tool friendly (Prettier or oxfmt).
29
+ - 📈 Supports scaling from single apps to monorepos.
30
30
 
31
- ## Install
31
+ ## 📦 Install
32
32
 
33
33
  ```shell
34
34
  # pnpm
@@ -44,7 +44,7 @@ yarn add -D eslint typescript @ntnyq/eslint-config
44
44
  bun add -D eslint typescript @ntnyq/eslint-config
45
45
  ```
46
46
 
47
- ## 60-Second Quick Start
47
+ ## ⚡ Quick start
48
48
 
49
49
  1. Create `eslint.config.mjs` in project root.
50
50
  2. Add npm scripts.
@@ -72,9 +72,9 @@ export default defineESLintConfig()
72
72
  pnpm lint
73
73
  ```
74
74
 
75
- ## Common Frontend Setups
75
+ ## 🧰 Common Frontend Setups
76
76
 
77
- ### Vite + Vue 3 + TypeScript
77
+ ### 💚 Vite + Vue 3 + TypeScript
78
78
 
79
79
  ```js
80
80
  // eslint.config.mjs
@@ -88,7 +88,7 @@ export default defineESLintConfig({
88
88
  })
89
89
  ```
90
90
 
91
- ### Vite + React + TypeScript
91
+ ### ⚛️ Vite + React + TypeScript
92
92
 
93
93
  ```js
94
94
  // eslint.config.mjs
@@ -102,7 +102,7 @@ export default defineESLintConfig({
102
102
  })
103
103
  ```
104
104
 
105
- ### Monorepo (apps + packages)
105
+ ### 🏗️ Monorepo (apps + packages)
106
106
 
107
107
  ```js
108
108
  // eslint.config.mjs
@@ -130,9 +130,9 @@ export default defineESLintConfig(
130
130
  )
131
131
  ```
132
132
 
133
- ## Configuration Patterns
133
+ ## ⚙️ Configuration Patterns
134
134
 
135
- ### Enable or disable modules
135
+ ### 🎛️ Enable or disable modules
136
136
 
137
137
  ```js
138
138
  import { defineESLintConfig } from '@ntnyq/eslint-config'
@@ -145,7 +145,7 @@ export default defineESLintConfig({
145
145
  })
146
146
  ```
147
147
 
148
- ### Override built-in rules
148
+ ### 🛠️ Override built-in rules
149
149
 
150
150
  ```js
151
151
  import { defineESLintConfig } from '@ntnyq/eslint-config'
@@ -164,7 +164,7 @@ export default defineESLintConfig({
164
164
  })
165
165
  ```
166
166
 
167
- ### Add project-specific flat config blocks
167
+ ### 🧱 Add project-specific flat config blocks
168
168
 
169
169
  ```js
170
170
  import { defineESLintConfig } from '@ntnyq/eslint-config'
@@ -179,14 +179,14 @@ export default defineESLintConfig({}, [
179
179
  ])
180
180
  ```
181
181
 
182
- ## Formatter Integration
182
+ ## 🎨 Formatter Integration
183
183
 
184
184
  Use one formatter strategy in a project:
185
185
 
186
186
  - Prettier path: install `prettier` and optional `@ntnyq/prettier-config`
187
187
  - Oxfmt path: install `oxfmt`
188
188
 
189
- ### Prettier example
189
+ ### 💅 Prettier example
190
190
 
191
191
  ```shell
192
192
  pnpm add -D prettier @ntnyq/prettier-config
@@ -201,7 +201,7 @@ import { defineConfig } from '@ntnyq/prettier-config'
201
201
  export default defineConfig()
202
202
  ```
203
203
 
204
- ### VS Code example
204
+ ### 🧑‍💻 VS Code example
205
205
 
206
206
  ```json
207
207
  {
@@ -214,7 +214,7 @@ export default defineConfig()
214
214
  }
215
215
  ```
216
216
 
217
- ## Optional Configs (Disabled by Default)
217
+ ## 🧩 Optional Configs (Disabled by Default)
218
218
 
219
219
  - `astro`
220
220
  - `eslintPlugin`
@@ -226,28 +226,28 @@ export default defineConfig()
226
226
 
227
227
  Enable them explicitly in `defineESLintConfig({ ... })` when needed.
228
228
 
229
- ## Inspect Final Rules
229
+ ## 🔎 Inspect Final Rules
230
230
 
231
231
  - Online inspector: [eslint-config-inspector.ntnyq.com](https://eslint-config-inspector.ntnyq.com/)
232
232
  - Local inspect: `npx eslint --inspect-config path/to/file.ts`
233
233
 
234
- ## Advanced API
234
+ ## 🧠 Advanced API
235
235
 
236
236
  - [Config options type](./src/types/config.ts)
237
237
  - [Factory implementation](./src/core.ts)
238
238
 
239
- ## Versioning Policy
239
+ ## 🏷️ Versioning Policy
240
240
 
241
241
  This project follows Semantic Versioning with opinionated lint rules:
242
242
 
243
243
  - Treated as breaking: Node.js engine changes, major plugin incompatibility, broad refactors.
244
244
  - Treated as non-breaking: enabling/disabling rules, rule option tuning, dependency bumps.
245
245
 
246
- ## Credits
246
+ ## 🙏 Credits
247
247
 
248
248
  - [@sxzz/eslint-config](https://github.com/sxzz/eslint-config)
249
249
  - [@antfu/eslint-config](https://github.com/antfu/eslint-config)
250
250
 
251
- ## License
251
+ ## 📄 License
252
252
 
253
253
  [MIT](./LICENSE) License © 2023-PRESENT [ntnyq](https://github.com/ntnyq)
package/dist/index.d.mts CHANGED
@@ -4628,7 +4628,7 @@ interface RuleOptions {
4628
4628
  * Disallow unmodified loop conditions
4629
4629
  * @see https://eslint.org/docs/latest/rules/no-unmodified-loop-condition
4630
4630
  */
4631
- 'no-unmodified-loop-condition'?: Linter.RuleEntry<[]>;
4631
+ 'no-unmodified-loop-condition'?: Linter.RuleEntry<NoUnmodifiedLoopCondition>;
4632
4632
  /**
4633
4633
  * Disallow ternary operators when simpler alternatives exist
4634
4634
  * @see https://eslint.org/docs/latest/rules/no-unneeded-ternary
@@ -5003,11 +5003,21 @@ interface RuleOptions {
5003
5003
  * @see https://eslint-plugin.ntnyq.com/rules/no-member-accessibility.html
5004
5004
  */
5005
5005
  'ntnyq/no-member-accessibility'?: Linter.RuleEntry<[]>;
5006
+ /**
5007
+ * disallow .only blocks in tests
5008
+ * @see https://eslint-plugin.ntnyq.com/rules/no-only-tests.html
5009
+ */
5010
+ 'ntnyq/no-only-tests'?: Linter.RuleEntry<NtnyqNoOnlyTests>;
5006
5011
  /**
5007
5012
  * require a newline after file header
5008
5013
  * @see https://eslint-plugin.ntnyq.com/rules/prefer-newline-after-file-header.html
5009
5014
  */
5010
5015
  'ntnyq/prefer-newline-after-file-header'?: Linter.RuleEntry<NtnyqPreferNewlineAfterFileHeader>;
5016
+ /**
5017
+ * require method syntax for inline functions in object literals
5018
+ * @see https://eslint-plugin.ntnyq.com/rules/prefer-object-method-syntax.html
5019
+ */
5020
+ 'ntnyq/prefer-object-method-syntax'?: Linter.RuleEntry<NtnyqPreferObjectMethodSyntax>;
5011
5021
  /**
5012
5022
  * Enforce consistent line breaks after opening and before closing braces
5013
5023
  * @see https://eslint.org/docs/latest/rules/object-curly-newline
@@ -6181,6 +6191,11 @@ interface RuleOptions {
6181
6191
  * @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-useless-mustaches/
6182
6192
  */
6183
6193
  'svelte/no-useless-mustaches'?: Linter.RuleEntry<SvelteNoUselessMustaches>;
6194
+ /**
6195
+ * require attribute interpolation instead of template literals
6196
+ * @see https://sveltejs.github.io/eslint-plugin-svelte/rules/prefer-attribute-interpolation/
6197
+ */
6198
+ 'svelte/prefer-attribute-interpolation'?: Linter.RuleEntry<[]>;
6184
6199
  /**
6185
6200
  * require class directives instead of ternary expressions
6186
6201
  * @see https://sveltejs.github.io/eslint-plugin-svelte/rules/prefer-class-directive/
@@ -11950,12 +11965,16 @@ type JsdocCheckLineAlignment = [] | [("always" | "never" | "any")] | [("always"
11950
11965
  // ----- jsdoc/check-param-names -----
11951
11966
  type JsdocCheckParamNames = [] | [{
11952
11967
  allowExtraTrailingParamDocs?: boolean;
11968
+ badParamNames?: boolean;
11969
+ badParamOrder?: boolean;
11953
11970
  checkDestructured?: boolean;
11954
11971
  checkRestProperty?: boolean;
11955
11972
  checkTypesPattern?: string;
11956
11973
  disableExtraPropertyReporting?: boolean;
11957
11974
  disableMissingParamChecks?: boolean;
11975
+ duplicateParams?: boolean;
11958
11976
  enableFixer?: boolean;
11977
+ extraParams?: boolean;
11959
11978
  useDefaultObjectProperties?: boolean;
11960
11979
  }];
11961
11980
  // ----- jsdoc/check-property-names -----
@@ -13649,6 +13668,10 @@ type NoUnderscoreDangle = [] | [{
13649
13668
  allowInArrayDestructuring?: boolean;
13650
13669
  allowInObjectDestructuring?: boolean;
13651
13670
  }];
13671
+ // ----- no-unmodified-loop-condition -----
13672
+ type NoUnmodifiedLoopCondition = [] | [{
13673
+ checkConditionalExpressions?: boolean;
13674
+ }];
13652
13675
  // ----- no-unneeded-ternary -----
13653
13676
  type NoUnneededTernary = [] | [{
13654
13677
  defaultAssignment?: boolean;
@@ -14009,10 +14032,23 @@ type NonblockStatementBodyPosition = [] | [("beside" | "below" | "any")] | [("be
14009
14032
  type NtnyqNoDuplicateExports = [] | [{
14010
14033
  style?: ("inline" | "separate");
14011
14034
  }];
14035
+ // ----- ntnyq/no-only-tests -----
14036
+ type NtnyqNoOnlyTests = [] | [{
14037
+ block?: string[];
14038
+ focus?: string[];
14039
+ functions?: string[];
14040
+ fix?: boolean;
14041
+ }];
14012
14042
  // ----- ntnyq/prefer-newline-after-file-header -----
14013
14043
  type NtnyqPreferNewlineAfterFileHeader = [] | [{
14014
14044
  tags?: string[];
14015
14045
  }];
14046
+ // ----- ntnyq/prefer-object-method-syntax -----
14047
+ type NtnyqPreferObjectMethodSyntax = [] | [{
14048
+ allowArrowFunctions?: (boolean | "singleLineOnly");
14049
+ allowedPropertyNames?: string[];
14050
+ fix?: boolean;
14051
+ }];
14016
14052
  // ----- object-curly-newline -----
14017
14053
  type ObjectCurlyNewline = [] | [((("always" | "never") | {
14018
14054
  multiline?: boolean;
@@ -14088,6 +14124,7 @@ type OxfmtOxfmt = [] | [{
14088
14124
  bracketSpacing?: boolean;
14089
14125
  embeddedLanguageFormatting?: ("auto" | "off");
14090
14126
  endOfLine?: ("lf" | "crlf" | "cr");
14127
+ experimentalOperatorPosition?: ("start" | "end");
14091
14128
  htmlWhitespaceSensitivity?: ("css" | "ignore" | "strict");
14092
14129
  ignorePatterns?: string[];
14093
14130
  insertFinalNewline?: boolean;
@@ -14169,6 +14206,7 @@ type OxfmtOxfmt = [] | [{
14169
14206
  bracketSpacing?: boolean;
14170
14207
  embeddedLanguageFormatting?: ("auto" | "off");
14171
14208
  endOfLine?: ("lf" | "crlf" | "cr");
14209
+ experimentalOperatorPosition?: ("start" | "end");
14172
14210
  htmlWhitespaceSensitivity?: ("css" | "ignore" | "strict");
14173
14211
  insertFinalNewline?: boolean;
14174
14212
  jsdoc?: (boolean | {
package/dist/index.mjs CHANGED
@@ -1624,6 +1624,10 @@ const configNtnyq = (options = {}) => [{
1624
1624
  rules: {
1625
1625
  "ntnyq/no-duplicate-exports": "error",
1626
1626
  "ntnyq/prefer-newline-after-file-header": "error",
1627
+ "ntnyq/prefer-object-method-syntax": ["error", {
1628
+ allowArrowFunctions: "singleLineOnly",
1629
+ fix: true
1630
+ }],
1627
1631
  ...options.overrides
1628
1632
  }
1629
1633
  }];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "7.0.0-beta.16",
4
+ "version": "7.0.0-beta.18",
5
5
  "description": "An opinionated ESLint config preset of ntnyq",
6
6
  "keywords": [
7
7
  "eslint",
@@ -41,15 +41,15 @@
41
41
  "peerDependencies": {
42
42
  "@html-eslint/eslint-plugin": "^0.64.0",
43
43
  "@html-eslint/parser": "^0.64.0",
44
- "astro-eslint-parser": "^3.0.0",
44
+ "astro-eslint-parser": "^3.1.0",
45
45
  "eslint": "^10.4.0",
46
- "eslint-plugin-astro": "^3.0.1",
47
- "eslint-plugin-eslint-plugin": "^7.5.0",
48
- "eslint-plugin-pnpm": "^1.6.1",
49
- "eslint-plugin-svelte": "^3.22.0",
46
+ "eslint-plugin-astro": "^3.1.0",
47
+ "eslint-plugin-eslint-plugin": "^7.6.2",
48
+ "eslint-plugin-pnpm": "^1.8.0",
49
+ "eslint-plugin-svelte": "^3.23.0",
50
50
  "eslint-plugin-unused-imports": "^4.4.1",
51
- "svelte": "^5.56.7",
52
- "svelte-eslint-parser": "^1.8.0"
51
+ "svelte": "^5.56.10",
52
+ "svelte-eslint-parser": "^1.8.1"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@html-eslint/eslint-plugin": {
@@ -90,9 +90,9 @@
90
90
  "@eslint/js": "^10.0.1",
91
91
  "@eslint/markdown": "^8.0.3",
92
92
  "@ntnyq/utils": "^0.21.1",
93
- "@unocss/eslint-plugin": "^66.7.5",
93
+ "@unocss/eslint-plugin": "^66.8.1",
94
94
  "@vitest/eslint-plugin": "^1.6.27",
95
- "eslint-config-flat-gitignore": "^2.3.0",
95
+ "eslint-config-flat-gitignore": "^2.4.0",
96
96
  "eslint-flat-config-utils": "^3.2.0",
97
97
  "eslint-import-resolver-typescript": "^4.4.5",
98
98
  "eslint-merge-processors": "^2.0.0",
@@ -103,50 +103,50 @@
103
103
  "eslint-plugin-depend": "^1.5.0",
104
104
  "eslint-plugin-github-action": "^0.3.0",
105
105
  "eslint-plugin-import-x": "^4.17.1",
106
- "eslint-plugin-jsdoc": "^64.1.0",
107
- "eslint-plugin-jsonc": "^3.4.1",
106
+ "eslint-plugin-jsdoc": "^64.2.1",
107
+ "eslint-plugin-jsonc": "^3.4.2",
108
108
  "eslint-plugin-n": "^18.3.0",
109
109
  "eslint-plugin-no-only-tests": "^3.4.0",
110
- "eslint-plugin-ntnyq": "^0.14.0",
111
- "eslint-plugin-oxfmt": "^0.17.0",
110
+ "eslint-plugin-ntnyq": "^0.15.1",
111
+ "eslint-plugin-oxfmt": "^0.20.0",
112
112
  "eslint-plugin-perfectionist": "^5.10.1",
113
113
  "eslint-plugin-pinia": "^0.4.2",
114
114
  "eslint-plugin-prettier": "^5.5.6",
115
- "eslint-plugin-regexp": "^3.1.1",
115
+ "eslint-plugin-regexp": "^3.2.0",
116
116
  "eslint-plugin-svgo": "^0.13.0",
117
117
  "eslint-plugin-toml": "^1.5.0",
118
118
  "eslint-plugin-unicorn": "^73.0.0",
119
119
  "eslint-plugin-vue": "^10.10.0",
120
120
  "eslint-plugin-yml": "^3.8.1",
121
121
  "eslint-processor-vue-blocks": "^2.0.0",
122
- "globals": "^17.9.0",
122
+ "globals": "^17.11.0",
123
123
  "jsonc-eslint-parser": "^3.3.0",
124
124
  "local-pkg": "^1.2.1",
125
125
  "toml-eslint-parser": "^1.0.3",
126
- "typescript-eslint": "^8.67.0",
126
+ "typescript-eslint": "^8.68.0",
127
127
  "vue-eslint-parser": "^10.4.1",
128
128
  "yaml-eslint-parser": "^2.1.0"
129
129
  },
130
130
  "devDependencies": {
131
- "@types/node": "^26.2.0",
132
- "@typescript-eslint/types": "^8.67.0",
131
+ "@types/node": "^26.4.0",
132
+ "@typescript-eslint/types": "^8.68.0",
133
133
  "@typescript/native-preview": "^7.0.0-dev.20260707.2",
134
- "bumpp": "^12.2.0",
134
+ "bumpp": "^12.2.2",
135
135
  "consola": "^3.4.2",
136
- "eslint": "^10.8.1",
136
+ "eslint": "^10.9.1",
137
137
  "eslint-typegen": "^2.3.1",
138
138
  "husky": "^9.1.7",
139
139
  "jiti": "^2.7.0",
140
140
  "nano-staged": "^1.0.2",
141
141
  "npm-run-all2": "^9.0.3",
142
- "oxfmt": "^0.63.0",
142
+ "oxfmt": "^0.65.0",
143
143
  "prettier": "^3.9.6",
144
144
  "tinyglobby": "^0.2.17",
145
145
  "tsdown": "^0.22.14",
146
146
  "tsx": "^4.23.12",
147
147
  "typescript": "^6.0.3",
148
148
  "uncase": "^0.3.0",
149
- "vitest": "^4.1.10"
149
+ "vitest": "^4.1.11"
150
150
  },
151
151
  "engines": {
152
152
  "node": "^22.23.0 || >=24.15.0"