js-style-kit 0.5.3 → 0.6.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
@@ -7,49 +7,21 @@ A zero-configuration style guide for ESLint and Prettier that provides sensible
7
7
  [![npm version](https://img.shields.io/npm/v/js-style-kit.svg)](https://www.npmjs.com/package/js-style-kit)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
9
  [![codecov](https://codecov.io/gh/drake-nathan/js-style-kit/graph/badge.svg?token=C57D67JAE0)](https://codecov.io/gh/drake-nathan/js-style-kit)
10
- ![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/drake-nathan/js-style-kit?labelColor=5C5C5C&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit%20Reviews)
11
-
12
- ## Overview
13
-
14
- JS Style Kit is a comprehensive, batteries-included linting and formatting solution for modern JavaScript and TypeScript projects.
15
-
16
- - ✅ All dependencies included (ESLint, Prettier, plugins) - no need to install peer deps
17
- - ✅ ESLint v9 flat config
18
- - ✅ ESM-only package
19
- - ✅ All rules configured as warnings
20
-
21
- ### Configs Included
22
-
23
- > **Note:** All configs are optional and can be disabled or configured.
24
-
25
- - ESlint
26
- - Base config - Tweaked version of "recommended" config
27
- - typescript-eslint - Falls somewhere between "recommended" and "strict"
28
- - eslint-plugin-perfectionist - automatically sort all imports, objects, props, etc.
29
- - eslint-plugin-import-x - faster version of eslint-plugin-import
30
- - eslint-plugin-unicorn - enforce consistent file names (kebab-case will save you so many headaches)
31
- - eslint-plugin-react - React rules
32
- - eslint-plugin-react-hooks - React hooks rules
33
- - eslint-plugin-react-refresh - React Fast Refresh validation for Vite
34
- - eslint-plugin-nextjs - Next.js rules
35
- - eslint-plugin-storybook - Storybook rules
36
- - eslint-plugin-turbo - Turborepo rules
37
- - eslint-plugin-jest - Jest rules
38
- - eslint-plugin-vitest - Vitest rules
39
- - Prettier
40
- - Default config
41
- - prettier-plugin-css-order
42
- - prettier-plugin-curly
43
- - prettier-plugin-packagejson
44
- - prettier-plugin-sort-json
45
- - prettier-plugin-tailwindcss
46
-
47
- > **Note:** This is very much a work in progress. I want to know what configuration changes you make, so please open an issue!
10
+
11
+ ## Features
12
+
13
+ - ✅ **Batteries included** - ESLint, Prettier, and all plugins bundled (no peer dependency headaches)
14
+ - **ESLint v9** flat config format
15
+ - ✅ **TypeScript** first with automatic project detection
16
+ - ✅ **Framework support** - React, Next.js, Vite, Remix, React Router
17
+ - ✅ **Auto-sorting** - Imports, objects, properties, and more
18
+ - ✅ **Smart defaults** - All rules configured as warnings (not errors)
19
+ - ✅ **Highly configurable** - Enable only what you need, what you don't use is left out of the config for efficiency
20
+ - ✅ **ESM-only** - For modern JavaScript projects
48
21
 
49
22
  ## Requirements
50
23
 
51
24
  - Node.js v20.11.0 or higher
52
- - TypeScript (for TypeScript projects, not bundled)
53
25
 
54
26
  ## Installation
55
27
 
@@ -63,426 +35,266 @@ pnpm add js-style-kit --save-dev
63
35
  bun add js-style-kit --dev
64
36
  ```
65
37
 
66
- ## ESLint Configuration
67
-
68
- ### ESLint Usage
38
+ ## Quick Start
69
39
 
70
- Create an `eslint.config.js` file in your project root:
40
+ ### Option 1: CLI (Recommended)
71
41
 
72
- ```js
73
- import { eslintConfig } from "js-style-kit";
42
+ The fastest way to get started is with our CLI tool:
74
43
 
75
- export default eslintConfig();
44
+ ```bash
45
+ npx js-style-kit init
76
46
  ```
77
47
 
78
- > **Note:** If you're not using `"type": "module"` in your package.json, name your file `eslint.config.mjs` instead.
48
+ This will:
79
49
 
80
- Setup your `package.json` commands:
50
+ 1. Install dependencies
51
+ 2. Create `style-kit.config.js`, `eslint.config.js`, and `prettier.config.js`
52
+ 3. Add npm scripts to your `package.json`
53
+ 4. Configure VS Code settings
81
54
 
82
- ```json
83
- {
84
- "scripts": {
85
- "lint": "eslint . --max-warnings 0",
86
- "lint:fix": "eslint . --fix --max-warnings 0"
87
- }
88
- }
89
- ```
55
+ [→ Learn more about the CLI](./bin/README.md)
90
56
 
91
- > **Note:** The `--max-warnings 0` option is important because all rules are set to warning by default.
57
+ ### Option 2: Manual Setup
92
58
 
93
- ### Configuration Options
59
+ #### ESLint
94
60
 
95
- The `eslintConfig()` function accepts a configuration object with the following options:
61
+ Create `eslint.config.js` (or `eslint.config.mjs` if not using `"type": "module"`):
96
62
 
97
63
  ```js
64
+ // @ts-check
98
65
  import { eslintConfig } from "js-style-kit";
99
66
 
100
- export default eslintConfig({
101
- // All options shown with their default values
102
- functionStyle: "arrow", // Controls function style: "arrow", "declaration", "expression", or "off"
103
- ignores: [], // Additional paths to ignore (node_modules and dist already excluded)
104
- importPlugin: true, // Whether to include import plugin rules
105
- jsdoc: { requireJsdoc: false }, // JSDoc configuration or false to disable
106
- react: false, // Whether to include React rules, see below for options
107
- rules: {}, // Custom rules to override or configure specific ESLint rules
108
- sorting: true, // Whether to include sorting rules from Perfectionist
109
- storybook: false, // Whether to include Storybook rules
110
- testing: {
111
- /* see Testing Configuration section */
112
- }, // Testing configuration or false to disable
113
- turbo: false, // Whether to include Turborepo rules
114
- typescript: true, // Boolean or string path to tsconfig.json
115
- unicorn: true, // Whether to include Unicorn rules
116
- });
117
- ```
118
-
119
- #### Function Style Configuration
120
-
121
- Controls how functions should be written. Some configurations are auto-fixable, but some require manual adjustment.
122
-
123
- ```js
124
- // Enforce arrow functions (default)
125
- functionStyle: "arrow";
126
-
127
- // Enforce function declarations
128
- functionStyle: "declaration";
129
-
130
- // Enforce function expressions
131
- functionStyle: "expression";
132
-
133
- // Disable function style enforcement
134
- functionStyle: "off";
135
- ```
136
-
137
- #### TypeScript Configuration
138
-
139
- TypeScript support is enabled by default. You can:
140
-
141
- ```js
142
- // Enable with automatic project detection
143
- typescript: true;
144
-
145
- // Disable TypeScript rules
146
- typescript: false;
147
-
148
- // Specify path to your tsconfig.json
149
- typescript: "./tsconfig.json";
150
- ```
151
-
152
- #### Import Plugin Configuration
153
-
154
- The import plugin rules are enabled by default. These rules help maintain proper import/export syntax and detect issues with imports.
155
-
156
- ```js
157
- // Enable import plugin (default)
158
- importPlugin: true;
159
-
160
- // Disable import plugin
161
- importPlugin: false;
162
- ```
163
-
164
- #### Custom Rules Configuration
165
-
166
- You can override or configure specific ESLint rules using the `rules` option:
167
-
168
- ```js
169
- // Add custom rule configurations
170
- rules: {
171
- // Format is the same as standard ESLint rule configuration
172
- "no-console": ["error", { allow: ["warn", "error"] }],
173
- "@typescript-eslint/no-explicit-any": "off",
174
- // Any valid ESLint rule can be configured here
175
- }
67
+ export default eslintConfig();
176
68
  ```
177
69
 
178
- #### React Configuration
179
-
180
- React support is disabled by default.
70
+ Add scripts to `package.json`:
181
71
 
182
- ```js
183
- // `true` enables standard react rules, react hook rules, and react compiler
184
- react: true
185
-
186
- // you can also pass an object to control react compiler, framework, and refresh support
187
- react: {
188
- reactRefresh: false, // Controls React Fast Refresh validation
189
- framework: "next" // "next", "vite", "none", "remix", or "react-router" to control related configurations
72
+ ```json
73
+ {
74
+ "scripts": {
75
+ "lint": "eslint . --max-warnings=0 --cache",
76
+ "lint:fix": "eslint . --fix --max-warnings=0 --cache"
77
+ }
190
78
  }
191
- // Using the framework option configures related features:
192
- // - "next": Includes Next.js config, excludes React Refresh by default
193
- // - "vite" or "none": Includes React Refresh by default, excludes Next.js
194
- // - "remix" or "react-router": Excludes both Next.js and React Refresh (these frameworks handle their own refresh logic)
195
- // - The reactRefresh property can override the framework-based behavior
196
79
  ```
197
80
 
198
- #### Testing Configuration
81
+ > **Note:** The `--max-warnings=0` flag is important since all rules are warnings by default.
199
82
 
200
- Testing rules are enabled by default with smart defaults. You can customize them or disable them entirely:
83
+ #### Prettier
201
84
 
202
- ```js
203
- // Disable testing rules
204
- testing: false;
205
-
206
- // Customize testing rules
207
- testing: {
208
- filenamePattern: "test", // "test" or "spec" for filename patterns
209
- files: ["**/*.{test,spec}.{ts,tsx,js,jsx}"], // File patterns to match
210
- formattingRules: true, // Whether to include formatting rules
211
- framework: "vitest", // "vitest" or "jest"
212
- itOrTest: "it", // Whether to use "it" or "test" as the test function
213
- };
214
- ```
215
-
216
- #### JSDoc Configuration
217
-
218
- JSDoc validation is enabled by default, but requirement rules are off:
85
+ Create `prettier.config.js` (or `prettier.config.mjs` if not using `"type": "module"`):
219
86
 
220
87
  ```js
221
- // Disable JSDoc validation completely
222
- jsdoc: false;
88
+ // @ts-check
89
+ import { prettierConfig } from "js-style-kit";
223
90
 
224
- // Enable JSDoc with requirement rules, ideal for libraries
225
- jsdoc: {
226
- requireJsdoc: true;
227
- }
91
+ export default prettierConfig();
228
92
  ```
229
93
 
230
- #### Additional Testing Options
231
-
232
- Testing support is enabled by default with Vitest configuration. You can customize it or disable it completely:
94
+ Add scripts to `package.json`:
233
95
 
234
- ```js
235
- // Disable testing configuration
236
- testing: false;
237
-
238
- // Enable with custom options
239
- testing: {
240
- filenamePattern: "spec", // "test" (.test, default) or "spec" (.spec)
241
- files: ["**/*.{test,spec}.{ts,tsx,js,jsx}"], // Override file patterns
242
- formattingRules: true, // Whether to include formatting rules like padding around blocks
243
- framework: "vitest", // "vitest" (default), "jest", "node", or "bun"
244
- itOrTest: "test", // "it" (default) or "test"
96
+ ```json
97
+ {
98
+ "scripts": {
99
+ "format": "prettier . --write --cache",
100
+ "format:check": "prettier . --check --cache"
101
+ }
245
102
  }
246
103
  ```
247
104
 
248
- #### Perfectionist (Code Organization)
249
-
250
- Sorting/organization rules from the Perfectionist plugin are enabled by default:
251
-
252
- ```js
253
- // Disable sorting rules
254
- sorting: false;
255
- ```
256
-
257
- #### Storybook Configuration
105
+ ## Configuration
258
106
 
259
- Storybook support is disabled by default, but can be enabled to provide linting rules specifically for Storybook files:
260
-
261
- ```js
262
- // Enable Storybook rules
263
- storybook: true;
264
- ```
265
-
266
- When enabled, this configuration:
267
-
268
- - Applies best practices for Storybook files (_.stories._ and _.story._)
269
- - Includes rules for Storybook configuration files (.storybook/main.\*)
270
- - Ensures the .storybook directory is not ignored by ESLint (adds a negation pattern to ignores)
271
-
272
- ### Adding Custom ESLint Configurations
273
-
274
- You can extend the base configuration by providing additional ESLint config objects as rest parameters:
107
+ ### ESLint Options
275
108
 
276
109
  ```js
277
110
  import { eslintConfig } from "js-style-kit";
278
111
 
279
112
  export default eslintConfig(
280
113
  {
281
- // Base configuration options
282
- typescript: "tsconfig.eslint.json",
283
- react: true,
114
+ // Core options
115
+ typescript: true, // Boolean or path to tsconfig.json
116
+ react: false, // React support (see React config docs)
117
+ functionStyle: "arrow", // "arrow" | "declaration" | "expression" | "off"
118
+
119
+ // Plugin toggles
120
+ importPlugin: true, // Import/export validation
121
+ sorting: true, // Auto-sort imports, objects, etc.
122
+ unicorn: true, // Enforce file naming and best practices
123
+ jsdoc: { requireJsdoc: false }, // JSDoc validation
124
+
125
+ // Framework & tools
126
+ query: false, // TanStack Query rules
127
+ testing: { framework: "vitest" }, // Test framework config
128
+ storybook: false, // Storybook rules
129
+ turbo: false, // Turborepo rules
130
+
131
+ // Advanced
132
+ ignores: [], // Additional ignore patterns
133
+ rules: {}, // Custom rule overrides
284
134
  },
285
- // Additional custom ESLint configuration objects
135
+ // Additional ESLint config objects
286
136
  {
287
137
  name: "custom-globals",
288
138
  languageOptions: {
289
139
  globals: {
290
140
  process: "readonly",
291
- __dirname: "readonly",
292
141
  },
293
142
  },
294
143
  },
295
- {
296
- name: "custom-rules",
297
- rules: {
298
- // Override or add specific rules
299
- "no-console": ["error", { allow: ["warn", "error"] }],
300
- "max-len": ["warn", { code: 100 }],
301
- quotes: ["error", "single"],
302
- },
303
- },
304
- // Add as many additional configs as needed
305
144
  );
306
145
  ```
307
146
 
308
- ## Prettier Configuration
147
+ ### Configuration Guides
309
148
 
310
- ### Prettier Usage
149
+ Each configuration has detailed documentation:
311
150
 
312
- Create a `prettier.config.js` file in your project root:
151
+ - **Core Configs**
152
+ - [Base ESLint Rules](./src/eslint/base/README.md)
153
+ - [TypeScript](./src/eslint/typescript/README.md)
154
+ - [Sorting (Perfectionist)](./src/eslint/perfectionist/README.md)
155
+ - [Import Plugin](./src/eslint/import/README.md)
156
+ - [Unicorn](./src/eslint/unicorn/README.md)
313
157
 
314
- ```js
315
- import { prettierConfig } from "js-style-kit";
158
+ - **Framework Configs**
159
+ - [React](./src/eslint/react/README.md) - React, hooks, compiler, and refresh support
160
+ - [TanStack Query](./src/eslint/query/README.md) - Query best practices
316
161
 
317
- export default prettierConfig();
318
- ```
319
-
320
- > **Note:** If you're not using `"type": "module"` in your package.json, name your file `prettier.config.mjs` instead.
321
-
322
- Setup your `package.json` commands:
162
+ - **Tool Configs**
163
+ - [Testing](./src/eslint/testing/README.md) - Vitest, Jest, Bun, Node
164
+ - [JSDoc](./src/eslint/jsdoc/README.md) - Documentation validation
165
+ - [Storybook](./src/eslint/storybook/README.md) - Component story rules
166
+ - [Turborepo](./src/eslint/turbo/README.md) - Monorepo rules
323
167
 
324
- ```json
325
- {
326
- "scripts": {
327
- "format": "prettier --write .",
328
- "format:check": "prettier --check ." // run this one in your CI
329
- }
330
- }
331
- ```
332
-
333
- ### Prettier Configuration
334
-
335
- The `prettierConfig()` function accepts a configuration object with the following options:
168
+ ### Prettier Options
336
169
 
337
170
  ```js
338
171
  import { prettierConfig } from "js-style-kit";
339
172
 
340
173
  export default prettierConfig({
341
- // All options shown with their default values
342
- cssOrderPlugin: true, // Enable CSS order plugin
343
- curlyPlugin: true, // Enable curly braces enforcement for all control statements
344
- jsonSortPlugin: true, // Enable JSON sorting plugin
345
- packageJsonPlugin: true, // Enable package.json sorting plugin
346
- tailwindPlugin: false, // Enable Tailwind CSS plugin (boolean, string[], or options object)
347
-
348
- // You can also pass any standard Prettier options
174
+ // Plugin options
175
+ cssOrderPlugin: true, // Sort CSS properties
176
+ curlyPlugin: true, // Enforce curly braces
177
+ jsonSortPlugin: true, // Sort JSON keys
178
+ packageJsonPlugin: true, // Sort package.json
179
+ tailwindPlugin: false, // Boolean, path to global css file, or config object
180
+ parser: "oxc", // "oxc" (faster) or "default"
181
+
182
+ // Standard Prettier options
349
183
  printWidth: 80,
350
184
  tabWidth: 2,
351
- // etc.
185
+ // ... any Prettier option
352
186
  });
353
187
  ```
354
188
 
355
- #### Tailwind CSS Support
356
-
357
- Tailwind CSS formatting is disabled by default. You can enable it in different ways:
358
-
359
- ```js
360
- // Enable Tailwind with default utility functions (clsx, cva, cn)
361
- tailwindPlugin: true
362
-
363
- // Enable Tailwind with custom utility functions
364
- tailwindPlugin: ["clsx", "cva", "cn", "myCustomFunction"]
365
-
366
- // Enable Tailwind with custom options
367
- tailwindPlugin: {
368
- tailwindFunctions: ["clsx", "cva", "myCustomFunction"],
369
- tailwindAttributes: ["tw"]
370
- }
371
- ```
189
+ [→ Full Prettier documentation](./src/prettier/README.md)
372
190
 
373
- #### CSS Properties Order
191
+ ## Framework Examples
374
192
 
375
- The CSS order plugin is enabled by default. It sorts CSS properties in a consistent order. You can disable it:
193
+ ### React with Next.js
376
194
 
377
195
  ```js
378
- // Disable CSS order plugin
379
- cssOrderPlugin: false;
380
- ```
381
-
382
- #### Curly Braces Enforcement
383
-
384
- The curly braces plugin is disabled by default. It enforces consistent use of curly braces for all control flow statements (`if`, `for`, `while`, etc.), even for single-line statements. This is equivalent to ESLint's `curly` rule with the `all` option, but applied at the Prettier formatting level:
385
-
386
- ```diff
387
- - if (abc) def;
388
- + if (abc) {
389
- + def;
390
- + }
391
- ```
392
-
393
- You can disable it:
196
+ import { eslintConfig } from "js-style-kit";
394
197
 
395
- ```js
396
- // Disable curly braces enforcement
397
- curlyPlugin: false;
198
+ export default eslintConfig({
199
+ typescript: "./tsconfig.json",
200
+ react: {
201
+ framework: "next",
202
+ reactCompiler: true, // React 19 compiler rules (enabled by default)
203
+ },
204
+ testing: {
205
+ framework: "vitest",
206
+ itOrTest: "it",
207
+ },
208
+ });
398
209
  ```
399
210
 
400
- #### JSON Sorting
401
-
402
- The JSON sorting plugin is enabled by default. You can disable it or configure it:
211
+ ### React with Vite
403
212
 
404
213
  ```js
405
- // Disable JSON sorting
406
- jsonSortPlugin: false;
214
+ import { eslintConfig } from "js-style-kit";
407
215
 
408
- // Configure JSON sorting
409
- jsonSortPlugin: {
410
- jsonRecursiveSort: true;
411
- // other plugin options...
412
- }
216
+ export default eslintConfig({
217
+ react: {
218
+ framework: "vite",
219
+ reactRefresh: true, // Fast Refresh validation (enabled by default with vite)
220
+ },
221
+ testing: { framework: "vitest" },
222
+ });
413
223
  ```
414
224
 
415
- #### Standard Prettier Options
416
-
417
- You can pass any standard Prettier options directly:
225
+ ### TypeScript Library
418
226
 
419
227
  ```js
420
- import { prettierConfig } from "js-style-kit";
421
-
422
- export default prettierConfig({
423
- // Enable Tailwind
424
- tailwindPlugin: true,
228
+ import { eslintConfig } from "js-style-kit";
425
229
 
426
- // Standard Prettier options
427
- printWidth: 100,
428
- tabWidth: 2,
429
- useTabs: false,
430
- semi: true,
431
- singleQuote: false,
432
- trailingComma: "all",
433
- bracketSpacing: true,
434
- endOfLine: "lf",
230
+ export default eslintConfig({
231
+ typescript: "./tsconfig.json",
232
+ jsdoc: { requireJsdoc: true }, // Enforce JSDoc for public APIs
233
+ testing: { framework: "bun" },
435
234
  });
436
235
  ```
437
236
 
438
- ## Complete Example
439
-
440
- Here's a complete example with both ESLint and Prettier configurations:
237
+ ## Adding Custom Rules
441
238
 
442
- ### eslint.config.js
239
+ You can override any rule or add custom configurations. If you disable a rule in the `rules` object, it will be removed from the config for efficiency.
443
240
 
444
241
  ```js
445
242
  import { eslintConfig } from "js-style-kit";
446
243
 
447
244
  export default eslintConfig(
448
245
  {
449
- typescript: "tsconfig.eslint.json",
246
+ typescript: true,
450
247
  react: true,
451
- jsdoc: { requireJsdoc: true },
452
- functionStyle: "arrow",
453
- // Use the built-in rules parameter for custom rules
454
248
  rules: {
249
+ // Override built-in rules
455
250
  "no-console": ["error", { allow: ["warn", "error"] }],
456
- },
457
- // Configure testing
458
- testing: {
459
- framework: "jest",
460
- itOrTest: "test",
251
+ "@typescript-eslint/no-explicit-any": "off",
461
252
  },
462
253
  },
463
- // You can still add additional config objects
254
+ // Additional ESLint config objects
464
255
  {
465
- name: "additional-config",
466
- rules: {
467
- // More custom rules
256
+ name: "custom-globals",
257
+ languageOptions: {
258
+ globals: {
259
+ process: "readonly",
260
+ },
468
261
  },
469
262
  },
470
263
  );
471
264
  ```
472
265
 
473
- ### prettier.config.js
474
-
475
- ```js
476
- import { prettierConfig } from "js-style-kit";
477
-
478
- export default prettierConfig({
479
- tailwindPlugin: true,
480
- cssOrderPlugin: true,
481
- printWidth: 100,
482
- singleQuote: true,
483
- });
484
- ```
266
+ ## What's Included
267
+
268
+ ### ESLint Plugins
269
+
270
+ - [`typescript-eslint`](https://typescript-eslint.io) - TypeScript linting
271
+ - [`eslint-plugin-perfectionist`](https://perfectionist.dev) - Auto-sorting
272
+ - [`eslint-plugin-import-x`](https://www.npmjs.com/package/eslint-plugin-import-x) - Import/export validation
273
+ - [`eslint-plugin-unicorn`](https://www.npmjs.com/package/eslint-plugin-unicorn) - Best practices & naming
274
+ - [`eslint-plugin-react`](https://www.npmjs.com/package/eslint-plugin-react) - React rules
275
+ - [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks) - React hooks rules
276
+ - [`eslint-plugin-react-refresh`](https://www.npmjs.com/package/eslint-plugin-react-refresh) - Fast Refresh validation
277
+ - [`eslint-plugin-nextjs`](../eslint-plugin-nextjs/README.md) - My fork of the Next.js plugin
278
+ - [`@tanstack/eslint-plugin-query`](https://tanstack.com/query/v4/docs/eslint/eslint-plugin-query) - TanStack Query rules
279
+ - [`eslint-plugin-jsdoc`](https://www.npmjs.com/package/eslint-plugin-jsdoc) - JSDoc validation
280
+ - [`eslint-plugin-storybook`](https://www.npmjs.com/package/eslint-plugin-storybook) - Storybook rules
281
+ - [`eslint-plugin-turbo`](https://www.npmjs.com/package/eslint-plugin-turbo) - Turborepo rules
282
+ - [`eslint-plugin-vitest`](https://www.npmjs.com/package/eslint-plugin-vitest) - Vitest rules
283
+ - [`eslint-plugin-jest`](https://www.npmjs.com/package/eslint-plugin-jest) - Jest rules
284
+
285
+ ### Prettier Plugins
286
+
287
+ - [`prettier-plugin-css-order`](https://www.npmjs.com/package/prettier-plugin-css-order) - CSS property ordering
288
+ - [`prettier-plugin-curly`](https://www.npmjs.com/package/prettier-plugin-curly) - Curly brace enforcement
289
+ - [`prettier-plugin-packagejson`](https://www.npmjs.com/package/prettier-plugin-packagejson) - package.json sorting
290
+ - [`prettier-plugin-sort-json`](https://www.npmjs.com/package/prettier-plugin-sort-json) - JSON sorting
291
+ - [`prettier-plugin-tailwindcss`](https://www.npmjs.com/package/prettier-plugin-tailwindcss) - Tailwind class sorting
292
+ - [`@prettier/plugin-oxc`](https://www.npmjs.com/package/@prettier/plugin-oxc) - Faster parser (optional)
485
293
 
486
294
  ## License
487
295
 
488
296
  MIT
297
+
298
+ ---
299
+
300
+ **Note:** This is a work in progress. Please [open an issue](https://github.com/drake-nathan/js-style-kit/issues) if you have suggestions or find any problems!
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ declare const configNames: {
18
18
  readonly nextjs: "nextjs";
19
19
  readonly perfectionist: "perfectionist";
20
20
  readonly preferArrowFunction: "prefer-arrow-function";
21
+ readonly query: "@tanstack/query";
21
22
  readonly react: "react";
22
23
  readonly reactRefresh: "react-refresh";
23
24
  readonly storybook: "storybook:stories";
@@ -52,6 +53,7 @@ interface EslintConfigOptions {
52
53
  jsdoc?: false | {
53
54
  requireJsdoc?: boolean;
54
55
  };
56
+ query?: boolean;
55
57
  react?: boolean | {
56
58
  framework?: "next" | "none" | "react-router" | "remix" | "vite";
57
59
  reactCompiler?: boolean;
@@ -73,6 +75,7 @@ interface EslintConfigOptions {
73
75
  * @param options.ignores - Additional paths to ignore. Already excludes `node_modules` and `dist`.
74
76
  * @param options.importPlugin - Whether to include the import plugin. Defaults to true.
75
77
  * @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.
78
+ * @param options.query - Whether to include TanStack Query rules.
76
79
  * @param options.react - Whether to include React, React hooks, and React compiler rules.
77
80
  * Can specify framework as "next", "none", "react-router", "remix", or "vite" to control related configs:
78
81
  * - "next": Includes Next.js config, excludes React Refresh.
@@ -94,7 +97,7 @@ interface EslintConfigOptions {
94
97
  * @param additionalConfigs - Additional ESLint config objects to be merged into the final configuration.
95
98
  * @returns An array of ESLint configuration objects.
96
99
  */
97
- declare const eslintConfig: ({ functionStyle, ignores, importPlugin, jsdoc, react, rules, sorting, storybook, testing, turbo, typescript, unicorn, }?: EslintConfigOptions, ...additionalConfigs: Linter.Config[]) => Linter.Config[];
100
+ declare const eslintConfig: ({ functionStyle, ignores, importPlugin, jsdoc, query, react, rules, sorting, storybook, testing, turbo, typescript, unicorn, }?: EslintConfigOptions, ...additionalConfigs: Linter.Config[]) => Linter.Config[];
98
101
 
99
102
  interface PrettierConfigOptions extends Config {
100
103
  cssOrderPlugin?: boolean;