eslint-config-un 0.9.0 → 1.0.0-alpha.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.
Files changed (71) hide show
  1. package/README.md +435 -78
  2. package/dist/angular-6KSIL7FP.js +314 -0
  3. package/dist/astro-3LI3COU7.js +83 -0
  4. package/dist/ava-EBOXDJ2K.js +46 -0
  5. package/dist/better-tailwind-Q5YFDAUL.js +65 -0
  6. package/dist/case-police-H43D4EWO.js +32 -0
  7. package/dist/chunk-7EC2AGQ3.js +141 -0
  8. package/dist/chunk-7FDJLMLY.js +106 -0
  9. package/dist/chunk-ESZUYGR7.js +265 -0
  10. package/dist/chunk-HDHWCCOH.js +35 -0
  11. package/dist/chunk-KM4LMACH.js +929 -0
  12. package/dist/chunk-OAFXKWGX.js +100 -0
  13. package/dist/cli-FC7BQBP6.js +41 -0
  14. package/dist/cloudfront-functions-MVQM5E4M.js +199 -0
  15. package/dist/cspell-7CA2AMMR.js +33 -0
  16. package/dist/css-BSKSCAXJ.js +61 -0
  17. package/dist/css-in-js-D75WSJQK.js +49 -0
  18. package/dist/cypress-XJQE5QJW.js +39 -0
  19. package/dist/de-morgan-GRLJSRL5.js +24 -0
  20. package/dist/depend-SQWB5JSY.js +37 -0
  21. package/dist/ember-2UFBWEQ5.js +70 -0
  22. package/dist/erasable-syntax-only-KFNDSY5S.js +33 -0
  23. package/dist/es-E67VL7UF.js +8 -0
  24. package/dist/eslint-comments-7JB3F6FP.js +41 -0
  25. package/dist/eslint-plugin-prettier-AFP3AEI3.js +1732 -0
  26. package/dist/graphql-KLHYXB2Q.js +154 -0
  27. package/dist/html-OSN6HWEU.js +49 -0
  28. package/dist/import-NYSST5B3.js +84 -0
  29. package/dist/index.d.ts +64403 -30848
  30. package/dist/index.js +506 -3855
  31. package/dist/jest-3REJ5PYC.js +136 -0
  32. package/dist/js-XWIJX42F.js +91 -0
  33. package/dist/js-inline-TJ23ZTMF.js +95 -0
  34. package/dist/jsdoc-AXSSJNIR.js +74 -0
  35. package/dist/json-schema-validator-TOUWSWW3.js +84 -0
  36. package/dist/jsonc-GHMMWFPL.js +59 -0
  37. package/dist/jsx-a11y-CV5UZD4C.js +8 -0
  38. package/dist/markdown-GRXVXOO5.js +166 -0
  39. package/dist/math-TNCI4CNH.js +32 -0
  40. package/dist/nextjs-RQ2HWRJU.js +42 -0
  41. package/dist/no-stylistic-rules-AP2C435P.js +6956 -0
  42. package/dist/no-unsanitized-JB3OIRTR.js +24 -0
  43. package/dist/node-IHTQDIHY.js +64 -0
  44. package/dist/node-dependencies-4OTIAEGJ.js +44 -0
  45. package/dist/package-json-2NLFPDC4.js +10 -0
  46. package/dist/perfectionist-64UGYXOL.js +119 -0
  47. package/dist/pnpm-MCGMQCFG.js +67 -0
  48. package/dist/prefer-arrow-functions-YFSEZPBR.js +30 -0
  49. package/dist/promise-ALG6INND.js +26 -0
  50. package/dist/qwik-OI3QGH35.js +41 -0
  51. package/dist/react-UQQITJAJ.js +525 -0
  52. package/dist/regexp-WGU4LZ2L.js +26 -0
  53. package/dist/security-HQOQTL65.js +26 -0
  54. package/dist/solid-PNKDJ4DQ.js +47 -0
  55. package/dist/sonar-WIDPVBJC.js +39 -0
  56. package/dist/storybook-QE2PNYD5.js +40 -0
  57. package/dist/svelte-JOGXWSBL.js +126 -0
  58. package/dist/tailwind-7K47IDWY.js +54 -0
  59. package/dist/tanstack-query-JLKL3XTN.js +24 -0
  60. package/dist/testing-library-YP6CJQ23.js +112 -0
  61. package/dist/toml-IDXCRMCT.js +57 -0
  62. package/dist/ts-6ZZW63FE.js +701 -0
  63. package/dist/turbo-5E5N5R2H.js +29 -0
  64. package/dist/unicorn-S3DWU4Q5.js +28 -0
  65. package/dist/unused-imports-7C3TOFD7.js +39 -0
  66. package/dist/vitest-SBZH36SH.js +85 -0
  67. package/dist/vue-USTYIDDC.js +372 -0
  68. package/dist/yaml-SBLNNQTE.js +66 -0
  69. package/package.json +133 -74
  70. package/dist/index.cjs +0 -3933
  71. package/dist/index.d.cts +0 -34778
package/README.md CHANGED
@@ -1,105 +1,462 @@
1
- # eslint-config-un
1
+ # eslint-config-un [![npm](https://img.shields.io/npm/v/eslint-config-un)](https://npmjs.com/eslint-config-un)
2
2
 
3
- [![npm](https://img.shields.io/npm/v/eslint-config-un)](https://www.npmjs.com/package/eslint-config-un)
3
+ Grown out of the personal collection of rules, an ESLint config aspiring to cover as many rules as possible, be reasonably strict and easily configurable.
4
4
 
5
- Grown out of the personal collection of rules, an ESLint config aspiring to cover as many rules as possible, be reasonably strict and easily configurable. Only supports ESLint 9 and the flat config format.
5
+ ## Features
6
+
7
+ - **Every major plugin** is included (50+ in total):
8
+ [![JavaScript](./assets/devicon-javascript.svg) Vanilla JS rules](https://eslint.org/docs/latest/rules),
9
+ [![TypeScript](./assets/devicon-typescript.svg) typescript-eslint](https://typescript-eslint.io/rules),
10
+ [🦄unicorn](https://npmjs.com/eslint-plugin-unicorn),
11
+ [⭐regexp](https://github.com/ota-meshi/eslint-plugin-regexp),
12
+ [![NodeJS](./assets/devicon-nodejs.svg) node](https://github.com/eslint-community/eslint-plugin-n),
13
+ [![VueJS](./assets/devicon-vuejs.svg) vue](https://eslint.vuejs.org),
14
+ [![Angular](./assets/devicon-angular.svg) angular](https://github.com/angular-eslint/angular-eslint)
15
+ [![ReactJS](./assets/devicon-react.svg) react](https://github.com/jsx-eslint/eslint-plugin-react) and 4 sister plugins,
16
+ [![SolidJS](./assets/devicon-solidjs.svg) solid](https://github.com/solidjs-community/eslint-plugin-solid),
17
+ [![tailwindcss](./assets/devicon-tailwindcss.svg) tailwind](https://github.com/francoismassart/eslint-plugin-tailwindcss),
18
+ [![CSS](./assets/devicon-css3.svg) css](https://github.com/eslint/css),
19
+ [![YAML](./assets/devicon-yaml.svg) yaml](https://github.com/ota-meshi/eslint-plugin-yml)
20
+ and many more;
21
+ - **Every single rule** was evaluated and given a reasonable default severity and options;
22
+ - **Extremely configurable:** you can easily override any rule's severity and **granularly** alter the default options;
23
+ - **Zero configuration by default:** exporting `eslintConfig()` from `eslint.config.ts` is enough to get started;
24
+ - **Strictly typed:** all the options and rule names exist in TypeScript types;
25
+ - **Well documented:** every single config, sub-config and their options are documented in JSDoc format;
26
+ - **Respects your `.gitignore`**: those files are not linted by default.
27
+ - Provides the ability **to disable autofix** on a per-rule basis.
28
+ - **Works great with Prettier**: conflicting rules are disabled if you use Prettier.
29
+ - **Rename plugin prefixes** easily if you would like to.
6
30
 
7
31
  ## Installation
8
32
 
33
+ Minimum supported versions:
34
+ - NodeJS: 20.10 or 21.1
35
+ - ESLint: 9.15.0 (peer dependency)
36
+
9
37
  ```shell
10
- npm i -D eslint-config-un
11
- pnpm i -D eslint-config-un
12
- yarn add -D eslint-config-un
38
+ npm i -D eslint-config-un eslint@latest
39
+ pnpm i -D eslint-config-un eslint@latest
40
+ yarn add -D eslint-config-un eslint@latest
13
41
  ```
14
42
 
43
+ Almost all the used plugins are direct dependencies of this package, you don't need to install them separately. We aim to update the dependencies within 1 month after their release.
44
+
45
+ Certain plugins are optional peer dependencies, which means that you need to install them manually if they are end up being used.
46
+
47
+ <details>
48
+ <summary>Optional peer dependencies & reason</summary>
49
+
50
+ The reason for making these plugins not coming with this package is because they have heavy non-optional peer dependencies, such as `graphql`, `storybook` and `tailwindcss`. Not only that they're heavy, but having those peer dependencies installed would make this package think that the corresponding config is used.
51
+
52
+ | Default plugin prefix | Package name |
53
+ | --------------------- | ------------ |
54
+ | `graphql` | `@graphql-eslint/eslint-plugin` |
55
+ | `betterTailwindcss` | `eslint-plugin-better-tailwindcss` |
56
+ | `storybook` | `eslint-plugin-storybook` |
57
+ | `tailwindcss` | `eslint-plugin-tailwindcss` |
58
+ | `turbo` | `eslint-plugin-turbo` |
59
+ </details>
60
+
61
+ ### Usage
62
+
63
+ In your `eslint.config.ts`:
64
+
65
+ ```ts
66
+ import {eslintConfig} from 'eslint-config-un';
67
+
68
+ export default eslintConfig({
69
+ // ... optional configuration ...
70
+ });
71
+ ```
72
+
73
+ <!-- eslint-disable-next-line markdown/no-missing-label-refs -->
74
+ > [!NOTE]
75
+ > We highly recommend using TypeScript config file, which is supported since eslint v9.18.0, or [`@ts-check` directive](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check) at the start of the file otherwise.
76
+
15
77
  ## List of configs
16
78
 
17
- Includes the rules from the following configs & plugins:
18
- - [Vanilla ESLint rules](https://eslint.org/docs/latest/rules/)
19
- - [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier) to disable Prettier-incompatible rules
20
- - [typescript-eslint](https://typescript-eslint.io/rules/)
21
- - [vue](https://eslint.vuejs.org/rules/) (+ [vuejs-accessibility](https://www.npmjs.com/package/eslint-plugin-vuejs-accessibility) and [pinia](https://www.npmjs.com/package/eslint-plugin-pinia))
22
- - [unicorn](https://www.npmjs.com/package/eslint-plugin-unicorn)
23
- - [node](https://www.npmjs.com/package/eslint-plugin-n) (`eslint-plugin-n` with `node` prefix)
24
- - [import](https://www.npmjs.com/package/eslint-plugin-import-x) (`eslint-plugin-import-x` with `import` prefix)
25
- - [promise](https://www.npmjs.com/package/eslint-plugin-promise)
26
- - [regexp](https://www.npmjs.com/package/eslint-plugin-regexp)
27
- - [security](https://www.npmjs.com/package/eslint-plugin-security)
28
- - [sonar](https://www.npmjs.com/package/eslint-plugin-sonarjs) (v3 since v0.4.0, v1 before)
29
- - [tailwind](https://www.npmjs.com/package/eslint-plugin-tailwindcss)
30
- - [jsonc](https://www.npmjs.com/package/eslint-plugin-jsonc) (since v0.1.4)
31
- - [yaml](https://www.npmjs.com/package/eslint-plugin-yaml) (since v0.1.0)
32
- - [toml](https://www.npmjs.com/package/eslint-plugin-toml) (since v0.1.3)
33
- - [prefer-arrow-functions](https://www.npmjs.com/package/eslint-plugin-prefer-arrow-functions) (since v0.1.0)
34
- - [eslint-comments](https://www.npmjs.com/package/@eslint-community/eslint-plugin-eslint-comments) (since v0.1.3)
35
- - [package-json](https://www.npmjs.com/package/eslint-plugin-package-json) (since v0.1.5)
36
- - [markdown](https://www.npmjs.com/package/@eslint/markdown) (since v0.2.0)
37
- - `cssInJs` (since v0.2.0), using [`eslint-plugin-css`](https://www.npmjs.com/package/eslint-plugin-css)
38
- - [jest](https://www.npmjs.com/package/eslint-plugin-jest) (+ [jest-extended](https://www.npmjs.com/package/eslint-plugin-jest-extended)) (since v0.3.0)
39
- - [vitest](https://www.npmjs.com/package/@vitest/eslint-plugin) (since v0.3.0)
40
- - [jsdoc](https://www.npmjs.com/package/eslint-plugin-jsdoc) (since v0.3.1)
41
- - [perfectionist](https://www.npmjs.com/package/eslint-plugin-perfectionist) (since v0.4.0)
42
- - [de-morgan](https://www.npmjs.com/package/eslint-plugin-de-morgan) (since v0.5.0)
43
- - [qwik](https://www.npmjs.com/package/eslint-plugin-qwik) (since v0.6.0)
44
- - [json-schema-validator](https://www.npmjs.com/package/eslint-plugin-json-schema-validator) (since v0.6.0)
45
- - `angular` (since v0.7.0), using [`@angular-eslint/eslint-plugin`](https://www.npmjs.com/package/@angular-eslint/eslint-plugin) and [`@angular-eslint/eslint-plugin-template`](https://www.npmjs.com/package/@angular-eslint/eslint-plugin-template)
46
- - `css` (since v0.7.0), using [`@eslint/css`](https://www.npmjs.com/package/@eslint/css)
47
- - `noUnusedImports` (since v0.7.0), using [`eslint-plugin-unused-imports`](https://www.npmjs.com/package/eslint-plugin-unused-imports)
48
- - `react` (since v0.8.0), using [`@eslint-react/eslint-plugin`](https://www.npmjs.com/package/@eslint-react/eslint-plugin), [`eslint-plugin-react`](https://www.npmjs.com/package/eslint-plugin-react), [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks), [`eslint-plugin-react-refresh`](https://www.npmjs.com/package/eslint-plugin-react-refresh) and [`eslint-plugin-react-compiler`](https://www.npmjs.com/package/eslint-plugin-react-compiler)
49
- - `jsxA11y` (since v0.8.0), using [`eslint-plugin-jsx-a11y`](https://www.npmjs.com/package/eslint-plugin-jsx-a11y)
50
- - `pnpm` (since v0.8.0), using [`eslint-plugin-pnpm`](https://www.npmjs.com/package/eslint-plugin-pnpm)
51
- - `nextJs` (since v0.9.0), using [`@next/eslint-plugin-next`](https://www.npmjs.com/package/@next/eslint-plugin-next)
52
- - `casePolice` (since v0.9.0), using [`eslint-plugin-case-police`](https://www.npmjs.com/package/eslint-plugin-case-police)
53
- - `astro` (since v0.9.0), using [`eslint-plugin-astro`](https://www.npmjs.com/package/eslint-plugin-astro)
79
+ eslint-config-un has a concept of Configs and Sub-configs. They are similar to ESLint flat config objects, but not the quite the same.
54
80
 
55
- ## Features
81
+ You can enable any Config by setting it to `true` or an object with the Config's options. Passing `false` disables the Config.
82
+
83
+ <details>
84
+ <summary>Config interface & docs</summary>
85
+
86
+ The Config has the following interface (exact types are simplified for docs):
87
+
88
+ ```ts
89
+ type UnConfig =
90
+ | boolean
91
+ | {
92
+ files?: string[];
93
+ ignores?: string[];
94
+
95
+ [RuleName in ('overrides' | 'overridesAny')]?: {
96
+ [RuleName in string]:
97
+ | Severity
98
+ | [Severity, RuleOptions[RuleName]]
99
+ | ((
100
+ // These are severity and options *maybe* set by eslint-config-un
101
+ ourSeverity: Severity,
102
+ ourOptions?: RuleOptions[RuleName],
103
+ ) => Severity | [Severity, RuleOptions[RuleName]]);
104
+ };
105
+
106
+ forceSeverity?: '2' | 'error' | '1' | 'warn';
107
+
108
+ [`config${string}`]: UnConfig; // These are Sub-configs
109
+
110
+ [customOptions: string]: unknown; // Custom config options, individual for each config
111
+ };
112
+
113
+ type Severity = 0 | 1 | 2 | 'off' | 'warn' | 'error';
114
+ ```
115
+
116
+ - The Config is usually tied to a one or more ESLint plugins and produces one or more ESLint flat config objects.
117
+ - Sub-configs are the same as Configs, but configured within Config options. All Sub-configs use `configXXX` naming convention.
118
+ - After evaluating all the flat configs, eslint-config-un will **load only those plugins that were actually used**, unless `loadPluginsOnDemand` option is set to `false`.
119
+ - `files` is an array of file globs to which this Config will be applied. If you specify an empty array `[]`, the Config **will be disabled**, but not its Sub-configs.
120
+ - `ignores` is exactly the same as ESLint's `ignores`.
121
+ - `overrides`/`overridesAny` is similar to ESLint's `rules`, but with a very important advantage: you can provide a function that will be called with the rule severity and options set by eslint-config-un, which allows you to **granularly override the options** or change the severity of each rule.
122
+ - The only difference between `overrides` and `overridesAny` is that `overridesAny` will allow any rule to be overridden (from TypeScript's stand point; technically you can pass any rule to `overrides` too), while `overrides` will only allow those rules which are tied to the config.
123
+ - `overridesAny` will be applied **after** `overrides`.
124
+ - `forceSeverity` allows to bulk override the severity of all the rules not overridden via `overrides` or `overridesAny`.
125
+ </details>
126
+
127
+ <br>
128
+
129
+ Sub-config is a Config located within Config's options. If the parent config is disabled, all its Sub-configs are disabled too. In the following table, Sub-configs have `/` in their names.
130
+
131
+ ### Most popular and well known
132
+
133
+ | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
134
+ | -------------- | ------------------------------------------- | ------------------------------------ | ----------------- |
135
+ | ![JavaScript](./assets/devicon-javascript.svg) `js` | ✅ | [Vanilla ESLint rules](https://eslint.org/docs/latest/rules) | - |
136
+ | ![TypeScript](./assets/devicon-typescript.svg) `ts` | ✅ | [typescript-eslint](https://npmjs.com/typescript-eslint) (`ts`) | Only rules **not** requiring type information. |
137
+ | ![TypeScript](./assets/devicon-typescript.svg) `ts/typeAware` | ✅ | ^ | Only rules requiring type information. |
138
+ | ![TypeScript](./assets/devicon-typescript.svg) `ts/noTypeAssertion` | ✅ | [eslint-plugin-no-type-assertion](https://npmjs.com/eslint-plugin-no-type-assertion) (`no-type-assertion`) | - |
139
+ | ![TypeScript](./assets/devicon-typescript.svg) `ts/sortTsconfigKeys` | ❌ | - | Sort type-level and `compilerOptions` keys in tsconfig files. |
140
+ | 🦄 `unicorn` | ✅ | [eslint-plugin-unicorn](https://npmjs.com/eslint-plugin-unicorn) (`unicorn`) | - |
141
+ | ⭐ `regexp` | ✅ | [eslint-plugin-regexp](https://npmjs.com/eslint-plugin-regexp) (`regexp`) | - |
142
+ | `promise` | ✅ | [eslint-plugin-promise](https://npmjs.com/eslint-plugin-promise) (`promise`) | - |
143
+ | `import` | ✅ | [eslint-plugin-import-x](https://npmjs.com/eslint-plugin-import-x) (`import`) | - |
144
+ | `sonarjs` | ✅ | [eslint-plugin-sonarjs](https://npmjs.com/eslint-plugin-sonarjs) (`sonarjs`) | - |
145
+ | `eslintComments` | ✅ | [@eslint-community/eslint-plugin-eslint-comments](https://npmjs.com/@eslint-community/eslint-plugin-eslint-comments) (`@eslint-community/eslint-comments`) | Since v0.1.3 |
146
+ | `jsdoc` | ✅ | [eslint-plugin-jsdoc](https://npmjs.com/eslint-plugin-jsdoc) (`jsdoc`) | Since v0.3.1 |
147
+ | `jsdoc/typescript` | ✅ (`ts` config is enabled) | - | Config for disabling or disabling certain rules for TypeScript files |
148
+
149
+ ### Web frameworks & related
150
+
151
+ | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
152
+ | -------------- | ------------------------------------------- | ------------------------------------ | ----------------- |
153
+ | ![VueJS](./assets/devicon-vuejs.svg) `vue` | ✅ (`vue` is installed) | [eslint-plugin-vue](https://npmjs.com/eslint-plugin-vue) (`vue`) | - |
154
+ | ![VueJS](./assets/devicon-vuejs.svg) `vue/a11y` | ✅ | [eslint-plugin-vuejs-accessibility](https://npmjs.com/eslint-plugin-vuejs-accessibility) (`vuejs-accessibility`) | - |
155
+ | ![Pinia](./assets/logos-pinia.svg) `vue/pinia` | ✅ | [eslint-plugin-pinia](https://npmjs.com/eslint-plugin-pinia) (`pinia`) | - |
156
+ | ![Angular](./assets/devicon-angular.svg) `angular` | ✅ (`@angular/core` is installed) | [@angular-eslint/eslint-plugin](https://npmjs.com/@angular-eslint/eslint-plugin) (`@angular-eslint`) | Since v0.78.0 |
157
+ | ![Angular](./assets/devicon-angular.svg) `angular/template` | ✅ | [@angular-eslint/eslint-plugin/template](https://npmjs.com/@angular-eslint/eslint-plugin/template) (`@angular-eslint/template`) | - |
158
+ | ![ReactJS](./assets/devicon-react.svg) `react` | ✅ (`react` is installed) | [eslint-plugin-react](https://npmjs.com/eslint-plugin-react) (`react`) | Since v0.8.0 |
159
+ | ![ReactJS](./assets/devicon-react.svg) `react/reactX` | ✅ | [@eslint-react/eslint-plugin](https://npmjs.com/@eslint-react/eslint-plugin) (`@eslint-react`) | - |
160
+ | ![ReactJS](./assets/devicon-react.svg) `react/hooks` | ✅ | [eslint-plugin-react-hooks](https://npmjs.com/eslint-plugin-react-hooks) (`react-hooks`)<br>[@eslint-react/eslint-plugin](https://npmjs.com/@eslint-react/eslint-plugin) (`@eslint-react`) | Includes rules with `@eslint-react/hooks-extra` prefix from `@eslint-react/eslint-plugin` |
161
+ | ![ReactJS](./assets/devicon-react.svg) `react/dom` | ✅ (`react-dom` is installed) | [@eslint-react/eslint-plugin](https://npmjs.com/@eslint-react/eslint-plugin) (`@eslint-react`)<br>[eslint-plugin-react](https://npmjs.com/eslint-plugin-react) | Includes rules with `@eslint-react/dom` prefix from `@eslint-react/eslint-plugin` and DOM related rules from `eslint-plugin-react` |
162
+ | ![ReactJS](./assets/devicon-react.svg) `react/refresh` | ✅ | [eslint-plugin-react-refresh](https://npmjs.com/eslint-plugin-react-refresh) (`react-refresh`) | - |
163
+ | ![ReactJS](./assets/devicon-react.svg) `react/compiler` | ✅ (if React version is at least 19) | [eslint-plugin-react-compiler](https://npmjs.com/eslint-plugin-react-compiler) (`react-compiler`) | - |
164
+ | ![ReactJS](./assets/devicon-react.svg) `react/allowDefaultExportsInJsxFiles` | ✅ | - | Config that allows default exports in all JSX files |
165
+ | ![NextJS](./assets/devicon-nextjs.svg) `nextJs` | ✅ (`next` is installed) | [@next/eslint-plugin-next](https://npmjs.com/@next/eslint-plugin-next) (`@next/next`) | Since v0.9.0 |
166
+ | ![SolidJS](./assets/devicon-solidjs.svg) `solid` | ✅ (`solid-js` is installed) | [eslint-plugin-solid](https://npmjs.com/eslint-plugin-solid) (`solid`) | Since v0.10.0 |
167
+ | ![SolidJS](./assets/devicon-qwik.svg) `qwik` | ✅ (`@builder.io/qwik` or `@qwik.dev/core` is installed) | [eslint-plugin-qwik](https://npmjs.com/eslint-plugin-qwik) (`qwik`) | Since v0.6.0 |
168
+ | ![Astro](./assets/devicon-astro.svg) `astro` | ✅ (`astro` is installed) | [eslint-plugin-astro](https://npmjs.com/eslint-plugin-astro) (`astro`) | Since v0.9.0<br>Without A11Y rules |
169
+ | ![Astro](./assets/devicon-astro.svg) `astro/jsxA11y` | ✅ | ^ | Only A11Y rules from `eslint-plugin-astro` |
170
+ | ![Svelte](./assets/devicon-svelte.svg) `svelte` | ✅ (`svelte` is installed) | [eslint-plugin-svelte](https://npmjs.com/eslint-plugin-svelte) (`svelte`) | Since v0.10.0 |
171
+ | ![Ember](./assets/devicon-ember.svg) `ember` | ✅ (`ember-source` is installed) | [eslint-plugin-ember](https://npmjs.com/eslint-plugin-ember) (`ember`) | Since v1.0.0 |
172
+ | ![TailwindCSS](./assets/devicon-tailwindcss.svg) `betterTailwind` | ✅ (`tailwindcss` is installed) | [eslint-plugin-better-tailwindcss](https://npmjs.com/eslint-plugin-better-tailwindcss) (`better-tailwindcss`) | Since v1.0.0<br>Supports v4 and v3 |
173
+ | ![TailwindCSS](./assets/devicon-tailwindcss.svg) `tailwind` | ❌ | [eslint-plugin-tailwindcss](https://npmjs.com/eslint-plugin-tailwindcss) (`tailwindcss`) | Only supports v3 |
174
+
175
+ ### Runtimes & related
176
+
177
+ | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
178
+ | -------------- | ------------------------------------------- | ------------------------------------ | ----------------- |
179
+ | ![NodeJS](./assets/devicon-nodejs.svg) `node` | ✅ | [eslint-plugin-n](https://npmjs.com/eslint-plugin-n) (`node`) | - |
180
+ | ![npm](./assets/devicon-npm.svg) `packageJson` | ❌ | [eslint-plugin-package-json](https://npmjs.com/eslint-plugin-package-json) (`package-json`) | Since v0.1.5 |
181
+ | ![npm](./assets/devicon-npm.svg) `nodeDependencies` | ❌ | [eslint-plugin-node-dependencies](https://npmjs.com/eslint-plugin-node-dependencies) (`node-dependencies`) | Since v0.10.0 |
182
+ | ![npm](./assets/devicon-npm.svg) `depend` | ❌ | [eslint-plugin-depend](https://npmjs.com/eslint-plugin-depend) (`depend`) | Since v1.0.0 |
183
+ | ![pnpm](./assets/devicon-pnpm.svg) `pnpm` | ✅ (pnpm is detected as a package manager) | [eslint-plugin-pnpm](https://npmjs.com/eslint-plugin-pnpm) (`pnpm`) | Since v0.8.0<br>Does nothing, split into sub-configs |
184
+ | ![pnpm](./assets/devicon-pnpm.svg) `pnpm/packageJson` | ✅ | ^ | Plugin rules related to `package.json` files |
185
+ | ![pnpm](./assets/devicon-pnpm.svg) `pnpm/pnpmWorkspace` | ✅ | ^ | Plugin rules related to `pnpm-workspace.yaml` file |
186
+ | ![AWS](./assets/devicon-amazonwebservices-wordmark.svg) `cloudfrontFunctions` | ❌ | - | Since v0.10.0<br>For linting [Amazon CloudFront Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-functions.html) written for JavaScript Runtime v2 |
187
+ | ![AWS](./assets/devicon-amazonwebservices-wordmark.svg) `cloudfrontFunctions/V1` | ❌ | - | Same, but for JavaScript Runtime v1 functions |
188
+
189
+ ### Languages
190
+
191
+ | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
192
+ | -------------- | ------------------------------------------- | ------------------------------------ | ----------------- |
193
+ | ![Markdown](./assets/mdi-language-markdown.svg) `markdown` | ✅ | [@eslint/markdown](https://npmjs.com/@eslint/markdown) (`markdown`) | Since v0.7.0<br>Configured to also lint fenced code blocks |
194
+ | ![Markdown](./assets/mdi-language-markdown.svg) `markdown/formatFencedCodeBlocks` | ✅ (`prettier` is installed) | [eslint-plugin-prettier](https://npmjs.com/eslint-plugin-prettier) (`prettier`) | Since v1.0.0<br>Format fenced code blocks inside Markdown files using Prettier |
195
+ | ![CSS](./assets/devicon-css3.svg) `css` | ✅ (unless `stylelint` is installed) | [@eslint/css](https://npmjs.com/@eslint/css) (`css`) | Since v0.7.0 |
196
+ | ![CSS](./assets/devicon-css3.svg) `cssInJs` | ✅ | [eslint-plugin-css](https://npmjs.com/eslint-plugin-css) (`css-in-js`) | Since v0.2.0<br>Lints inlined CSS |
197
+ | `jsxA11y` | ✅ | [eslint-plugin-jsx-a11y](https://npmjs.com/eslint-plugin-jsx-a11y) (`jsx-a11y`) | Since v0.8.0 |
198
+ | ![YAML](./assets/devicon-yaml.svg) `yaml` | ❌ | [eslint-plugin-yaml](https://npmjs.com/eslint-plugin-yaml) (`yaml`) | Since v0.1.0 |
199
+ | ![JSON](./assets/devicon-json.svg) `jsonc` | ❌ | [eslint-plugin-jsonc](https://npmjs.com/eslint-plugin-jsonc) (`jsonc`) | Since v0.1.4<br>Supports JSON, JSON5, JSONC |
200
+ | `jsonc/json` | ❌ | ^ | Config exclusively for `.json` files, does nothing by default |
201
+ | `jsonc/jsonc` | ❌ | ^ | Config exclusively for `.jsonc` files, does nothing by default |
202
+ | `jsonc/json5` | ❌ | ^ | Config exclusively for `.json5` files, does nothing by default |
203
+ | `jsonSchemaValidator` | ❌ | [eslint-plugin-json-schema-validator](https://npmjs.com/eslint-plugin-json-schema-validator) (`json-schema-validator`) | Since v0.6.0 |
204
+ | ![TOML](./assets/tabler-toml.svg) `toml` | ❌ | [eslint-plugin-toml](https://npmjs.com/eslint-plugin-toml) (`toml`) | Since v0.1.3 |
205
+ | ![HTML](./assets/devicon-html5.svg) `html` | ✅ | [@html-eslint/eslint-plugin](https://npmjs.com/@html-eslint/eslint-plugin) (`@html-eslint`) | Since v0.10.0 |
206
+ | ![GraphQL](./assets/logos-graphql.svg) `graphql` | ✅ (`graphql` is installed) | [@graphql-eslint/eslint-plugin](https://npmjs.com/@graphql-eslint/eslint-plugin) (`graphql`) | Since v1.0.0 |
207
+
208
+ ### JS/TS - Miscellaneous
209
+
210
+ | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
211
+ | -------------- | ------------------------------------------- | ------------------------------------ | ----------------- |
212
+ | `security` | ❌ | [eslint-plugin-security](https://npmjs.com/eslint-plugin-security) (`security`) | - |
213
+ | `unusedImports` | ❌ | [eslint-plugin-unused-imports](https://npmjs.com/eslint-plugin-unused-imports) (`unused-imports`) | Since v0.7.0 |
214
+ | `unusedImports/noUnusedVars` | ❌ | ^ | Disables [`no-unused-vars`](https://eslint.org/docs/latest/rules/no-unused-vars), [`ts/no-unused-vars`](https://typescript-eslint.io/rules/no-unused-vars) and [`sonarjs/no-unused-vars`](https://sonarsource.github.io/rspec/#/rspec/S1481/javascript) rules in favor of `unused-imports/no-unused-vars` |
215
+ | `prefer-arrow-functions` | ❌ | [eslint-plugin-prefer-arrow-functions](https://npmjs.com/eslint-plugin-prefer-arrow-functions) (`prefer-arrow-functions`) | Since v0.1.0 |
216
+ | `perfectionist` | ❌ | [eslint-plugin-perfectionist](https://npmjs.com/eslint-plugin-perfectionist) (`perfectionist`) | Since v0.4.0<br>Supports sub-configs for each rule from the plugin since v1.0.0 |
217
+ | `de-morgan` | ❌ | [eslint-plugin-de-morgan](https://npmjs.com/eslint-plugin-de-morgan) (`de-morgan`) | Since v0.5.0 |
218
+ | `es` | ❌ | [eslint-plugin-es-x](https://npmjs.com/eslint-plugin-es-x) (`es-x`) | Since v0.10.0 |
219
+ | `jsInline` | ✅ | [eslint-plugin-html](https://npmjs.com/eslint-plugin-html) (`html`) | Since v0.10.0<br>For linting inlined JS in HTML files |
220
+ | `math` | ✅ | [eslint-plugin-math](https://npmjs.com/eslint-plugin-math) (`math`) | Since v1.0.0 |
221
+ | `erasableSyntaxOnly` | ❌ | [eslint-plugin-erasable-syntax-only](https://npmjs.com/eslint-plugin-erasable-syntax-only) (`erasable-syntax-only`) | Since v1.0.0 |
222
+
223
+ ### Libraries
224
+
225
+ | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
226
+ | -------------- | ------------------------------------------- | ------------------------------------ | ----------------- |
227
+ | `jest` | ✅ (`jest` is installed) | [eslint-plugin-jest](https://npmjs.com/eslint-plugin-jest) (`jest`) | Since v0.3.0 |
228
+ | `jest/extended` | ✅ (`jest-extended` is installed) | [eslint-plugin-jest-extended](https://npmjs.com/eslint-plugin-jest-extended) (`jest-extended`) | - |
229
+ | `jest/typescript` | ✅ (`ts` config is enabled) | [eslint-plugin-jest](https://npmjs.com/eslint-plugin-jest) (`jest`) | Only TypeScript-specific rules from `eslint-plugin-jest` |
230
+ | `vitest` | ✅ (`vitest` is installed) | [@vitest/eslint-plugin](https://npmjs.com/@vitest/eslint-plugin) (`vitest`) | Since v0.3.0 |
231
+ | `ava` | ✅ (`ava` is installed) | [eslint-plugin-ava](https://npmjs.com/eslint-plugin-ava) (`ava`) | Since v1.0.0 |
232
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary` | ✅ (`@testing-library/dom` is installed) | [eslint-plugin-testing-library](https://npmjs.com/eslint-plugin-testing-library) (`testing-library`) | Since v1.0.0 |
233
+ | `tanstackQuery` | ✅ (`@tanstack/query-core` is installed) | [@tanstack/eslint-plugin-query](https://npmjs.com/@tanstack/eslint-plugin-query) (`@tanstack/query`) | Since v1.0.0 |
234
+ | ![Storybook](./assets/logos-storybook-icon.svg) `storybook` | ✅ (`storybook` is installed) | [eslint-plugin-storybook](https://npmjs.com/eslint-plugin-storybook) (`storybook`) | Since v1.0.0 |
235
+ | ![Cypress](./assets/vscode-icons-file-type-light-cypress.svg) `cypress` | ✅ (`cypress` is installed) | [eslint-plugin-cypress](https://npmjs.com/eslint-plugin-cypress) (`cypress`) | Since v1.0.0 |
236
+ | ![Turborepo](./assets/material-icon-theme-turborepo.svg) `turbo` | ✅ (`turbo` is installed) | [eslint-plugin-turbo](https://npmjs.com/eslint-plugin-turbo) (`turbo`) | Since v1.0.0 |
237
+
238
+ ### Miscellaneous
239
+
240
+ | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
241
+ | -------------- | ------------------------------------------- | ------------------------------------ | ----------------- |
242
+ | `casePolice` | ❌ | [eslint-plugin-case-police](https://npmjs.com/eslint-plugin-case-police) (`case-police`) | Since v0.9.0 |
243
+ | `noStylisticRules` | ❌ | - | Since v1.0.0<br>Config to disable most of the stylistic rules. Can be useful when integrating eslint-config-un into an existing project. |
244
+ | `noUnsanitized` | ✅ | [eslint-plugin-no-unsanitized](https://npmjs.com/eslint-plugin-no-unsanitized) (`no-unsanitized`) | Since v1.0.0 |
245
+ | ![CSpell](./assets/vscode-icons-file-type-cspell.svg) `cspell` | ❌ | [@cspell/eslint-plugin](https://npmjs.com/package/@cspell/eslint-plugin) (`@cspell`) | Since v1.0.0 |
246
+
247
+ ## How to use
248
+
249
+ ### Rules configuration (`configs` and `extraConfigs` option)
250
+
251
+ Example of configuration:
252
+
253
+ ```ts
254
+ import {eslintConfig} from 'eslint-config-un';
255
+
256
+ export default eslintConfig({
257
+ configs: {
258
+ // This is a Config
259
+ node: {
260
+ // By default `node` rules are applied to all files, so let's narrow the file list down
261
+ files: ['backend/**'],
262
+ },
263
+ vue: {
264
+ // For some reason we're not ready to lint *.vue files
265
+ files: [],
266
+ // This is a Sub-config
267
+ configPinia: {
268
+ ignores: ['./path/to/pinia/store/with-many-error.ts'],
269
+ },
270
+ },
271
+ // This config is disabled too, and if we provide an object with configuration, it will be enabled too
272
+ perfectionist: {
273
+ files: ['src/big-list-of-something.ts'],
274
+ overrides: {
275
+ 'perfectionist/sort-objects': 2,
276
+ },
277
+ },
278
+ // This plugin is enabled by default, but we don't use JSDoc so don't need it
279
+ jsdoc: false,
280
+ // This plugin is conversely disabled by default, but we want to use it
281
+ security: true,
282
+ },
283
+ });
284
+ ```
285
+
286
+ #### Providing user defined flag configs
287
+
288
+ You can provide your own configs by using `extraConfigs` option. The provided configs will be placed after all the eslint-config-un's configs, and before the config which disables Prettier incompatible rules for all files.
289
+
290
+ Example:
291
+
292
+ ```ts
293
+ import {eslintConfig} from 'eslint-config-un';
294
+
295
+ export default eslintConfig({
296
+ configs: {
297
+ /* ... */
298
+ },
299
+
300
+ extraConfigs: [
301
+ {
302
+ files: ['src/big-list-of-something.ts'],
303
+ rules: {
304
+ 'perfectionist/sort-objects': 2,
305
+ 'perfectionist/sort-object-types': 2,
306
+ },
307
+ },
308
+
309
+ // More flat configs ...
310
+ ],
311
+ });
312
+ ```
313
+
314
+ ### Plugin prefixes (`pluginRenames` option)
56
315
 
57
- - Automatically detects the presence of `typescript`, `vue`, `nuxt`, `pinia`, `jest`, `jest-extended`, `vitest`, `@builder.io/qwik`, `@qwik.dev/core`, `@angular/core`, `react`, `next` and `astro` packages and enables corresponding configurations (which can also be enabled or disabled explicitly).
58
- - Every block of rules supports `overrides` for rules.
59
- - Designed to be used separately from Prettier: *almost* all the rules potentially conflicting with Prettier are disabled *by default*.
60
- - Written in TypeScript so all the options are typed.
316
+ ESLint plugins are registered with an arbitrary user-provided prefix, such as `unicorn` or `vue`. Then the rule name are formed by combining the prefix with the rule name, for example `unicorn/no-useless-undefined`.
61
317
 
62
- ## Usage
318
+ eslint-config-un provides the ability to change any registered plugin prefix. Additionally, some plugins are registered with a different prefix than their documentation suggests. If you would like to rename them back or rename some other plugins, you can use `pluginRenames` option, which is a map from the "canonical" prefixes to the user defined ones.
63
319
 
64
- In your `eslint.config.[cm]?js`:
320
+ #### Default renames
65
321
 
66
- ```js
67
- // @ts-check
322
+ | Plugin | Suggested prefix | Our prefix | Reason |
323
+ | -------------------------------------------------------------------- | -------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------- |
324
+ | [`typescript-eslint`](https://npmjs.com/typescript-eslint) | `@typescript-eslint` | `ts` | More concise and convenient to use |
325
+ | [`eslint-plugin-import-x`](https://npmjs.com/eslint-plugin-import-x) | `import-x` | `import` | This plugin is a fork and is meant to replace the original plugin with `import` prefix |
326
+ | [`eslint-plugin-n`](https://npmjs.com/eslint-plugin-n) | `n` | `node` | Same ^ |
327
+ | [`eslint-plugin-css`](https://npmjs.com/eslint-plugin-css) | `css` | `css-in-js` | Conflicts with [`@eslint/css`](https://npmjs.com/@eslint/css) and our name better captures the essence of the plugin |
328
+
329
+ <!-- eslint-disable-next-line markdown/no-missing-label-refs -->
330
+ > [!NOTE]
331
+ > If you rename a plugin, you still have to use the original prefix within `overrides`, `overridesAny` and `extraConfigs`. eslint-config-un will rename the rules accordingly for you.
332
+
333
+ <!-- eslint-disable-next-line markdown/no-missing-label-refs -->
334
+ > [!WARNING] Renaming plugins and `eslint-disable` directives
335
+ > If you rename a plugin, you will have to manually rename the rules within `eslint-disable-*` directives.
336
+
337
+ ### Disabling rule autofix
338
+
339
+ ESLint [doesn't (yet?) have the ability to disable autofix](https://github.com/eslint/rfcs/pull/125) for a rule by the user on per-rule basis. Our config attempts to provide this missing functionality by providing the limited ability to disable autofix for a rule as a whole or per-file and per-rule basis, but with a caveat that the rule will have `disable-autofix` prefix in its name. Additionally, we disable autofix for some rules by default, the list of which is available below.
340
+
341
+ To disable autofix for a rule, use an object notation for the rule entry:
342
+
343
+ ```ts
68
344
  import {eslintConfig} from 'eslint-config-un';
69
345
 
70
346
  export default eslintConfig({
71
- // your configuration (optional)
347
+ configs: {
348
+ unicorn: {
349
+ overrides: {
350
+ 'unicorn/better-regex': {
351
+ severity: 2,
352
+ disableAutofix: 'prefixed', // or `unprefixed` or `true`/`false`
353
+ },
354
+ },
355
+ },
356
+ },
72
357
  });
73
358
  ```
74
359
 
75
- ## Notes
76
-
77
- - You don't need to install any of the mentioned configs/plugins as they are all the dependencies of this package.
78
- - This package has a peer dependency of `eslint>=9`. Please ensure you have installed the correct version. Some package managers are installing non-optional peer dependencies automatically.
79
- - Packages lookup (such as `typescript` or `vue`) is performed using [`local-pkg`](https://www.npmjs.com/package/local-pkg).
80
- - Type-checked, or type-aware TypeScript rules are *enabled* by default which are known to be performance-demanding. It's just a little heads-up and you should make your own decision whether to keep them enabled. [More about type-aware linting](https://typescript-eslint.io/getting-started/typed-linting).
81
- - By default, TypeScript rules will be enabled in `.vue` files if `enforceTypescriptInScriptSection` is set to true in vue's config options which in turn is *automatically* set to true if `typescript` package found installed. If you have `.vue` files authored in both TypeScript and JavaScript, use `enforceTypescriptInScriptSection.{files,ignores}` to manually specify TS & JS Vue components respectively. It is not currently possible to apply different ESLint rules depending on the value of `lang` attribute of `<script>` SFC section.
82
- - All configs listed above are enabled by default or enabled automatically under certain conditions, but there is some that are *disabled* by default:
83
- - `preferArrowFunctions`
84
- - `security`
85
- - `json`
86
- - `yaml`
87
- - `toml`
88
- - `packageJson`
89
- - `perfectionist`
90
- - `deMorgan`
91
- - `jsonSchemaValidator`
92
- - `casePolice`
93
- - Some rules are set to warn by default. You can change some or even all such rule's reporting level using `errorsInsteadOfWarnings` option. You can find all such rules by inspecting the source code of this package.
94
-
95
- ### Certain rules are disabled for code blocks inside `*.md` files
96
-
97
- If `markdown` config is enabled (which is the default), the same rules provided by other configs will be applied to code blocks (\```lang ... \```) inside Markdown files. This works because under the hood the plugin [`@eslint/markdown`](https://www.npmjs.com/package/@eslint/markdown) that provides that functionality will create virtual files for each code block with the same extension as specified after ```.
360
+ * `unprefixed`: will disable autofix without changing the name of the rule, but it will be disabled for **all** files.
361
+ * `prefixed`: will create a plugin with `disable-autofix` prefix and copy this rule into it. The final rule is going to be `disable-autofix/<rule-name>` and `<rule-name>` will be disabled in the resulting flat config.
362
+ * `true`: use the default autofix disabling method, determined in `disableAutofixMethod.default` root option, which defaults to `unprefixed`.
363
+ * `false`: re-enable autofix for the rule (does nothing if autofix for this rule is disabled anywhere else with `unprefixed` method).
364
+
365
+ ## Configs notes
366
+
367
+ ### TypeScript
368
+
369
+ Rules [requiring type information](https://typescript-eslint.io/rules/?=typeInformation), which are [known to be performance-demanding](https://typescript-eslint.io/getting-started/typed-linting/#performance), are *enabled* by default, and will be applied to the same files as `ts` config is applied to. It's just a little heads up; you should make your own decision whether to keep them enabled. Use `configTypeAware` to control to which files such rules will be applied to, if any.
370
+
371
+ ### Frontend frameworks
372
+
373
+ We detect the version of the used frontend framework (Angular, Vue, Svelte, etc.) and apply the appropriate rules depending on the version. You can always manually specify the version using an appropriate option. Consult JSDoc of each config for more details.
374
+
375
+ #### Vue
376
+
377
+ By default, TypeScript rules will be enabled in `.vue` files if `enforceTypescriptInScriptSection` is set to true in vue's config options which in turn is *automatically* set to true if `ts` config is enabled. If you have `.vue` files authored in both TypeScript and JavaScript, use `enforceTypescriptInScriptSection.{files,ignores}` to manually specify TS & JS Vue components respectively. It is not currently possible to apply different ESLint rules depending on the value of `lang` attribute of `<script>` SFC section.
378
+
379
+ #### Angular
380
+
381
+ We support Angular versions from 13 to 19, all at once. This is achieved by generating an ESLint plugin specifically for the detected Angular version. Internally, `@angular-eslint/eslint-plugin` of versions 19 and 18, and `@angular-eslint/eslint-plugin-template` of versions 17 and 19 are used. We smartly enable the appropriate rules for each Angular version.
382
+
383
+ With this approach, we offer a unique ability to port the rules added in newer versions of `@angular-eslint/eslint-plugin*` and use them with older rules on older Angular codebases. Use `portRules` option to control which rules will be ported.
384
+
385
+ #### React
386
+
387
+ We use rules from several plugins to lint your React code. You will be able to choose whether you would like to use only `eslint-plugin-react` or `@eslint-react/eslint-plugin`, or both, which is the default.
388
+
389
+ ### Markdown
390
+
391
+ If `markdown` config is enabled (which is the default), the same rules provided by other configs will be applied to code blocks (\```lang ... \```) inside Markdown files. This works because under the hood the plugin [`@eslint/markdown`](https://npmjs.com/@eslint/markdown) that provides that functionality will create virtual files for each code block with the same extension as specified after ```.
98
392
 
99
393
  But applying certain rules for code blocks might not be desirable because some of them are too strict for the code that won't be executed anyway or even unfixable (like missing imports). You can find the full list of disabled rules in `src/configs/markdown.ts` file.
100
394
 
101
- ## Troubleshooting
395
+ ## Other root options
396
+
397
+ ### `ignores`
398
+
399
+ Specifies a list of globally ignored files. By default will be merged with our ignore patterns, unless `overrideIgnores` is set to `true`.
400
+
401
+ ### `overrideIgnores`
402
+
403
+ Set to `true` if you don't want `ignores` to be merged with our ignore patterns, which are `['**/dist']`.
404
+
405
+ ### `gitignore`
406
+
407
+ By default `.gitignore`d files will be added to `ignores` list. Set to `false` to disable this behavior. You may also provide an object which configures [eslint-config-flat-gitignore](https://npmjs.com/eslint-config-flat-gitignore), which provides this functionality in the first place.
408
+
409
+ ### `mode`
410
+
411
+ Type of your project, either application (`app`, default) or library (`lib`). Will affect certain rules, actual list of which is written in JSDoc of this option.
412
+
413
+ ### `disablePrettierIncompatibleRules`
414
+
415
+ Disables rules that are potentially conflicting with Prettier. [`eslint-config-prettier`](https://npmjs.com/eslint-config-prettier) is used under the hood, with a few exceptions. Defaults to `true` if `prettier` package is installed.
416
+
417
+ ### `forceSeverity`
418
+
419
+ Globally forces non-zero severity of all the rules configured by eslint-config-un (i.e. not within `overrides`, `overridesAny` or `extraConfigs`). This can also be configured per-config.
420
+
421
+ ## FAQ
422
+
423
+ ### How do I add my own flat configs?
424
+
425
+ Use `extraConfigs` option. The configs provided there will be placed after all the eslint-config-un's configs, and before the config which disables Prettier incompatible rules for all files. These configs have a richer `rules` option, which allows you to apply more settings like `overrides` option does.
426
+
427
+ Alternatively, you can `await` the `eslintConfig()` function and then add your own flat configs to whatever place you like (we recommend use [flat config composer from `eslint-flat-config-utils` package](https://npmjs.com/eslint-flat-config-utils)) for this purpose.
428
+
429
+ ### Do I have to install any of the used plugins?
430
+
431
+ No! All the used plugins are direct dependencies of this package, you don't need to install them separately. We aim to update the dependencies within 1 month after their release. If anything, you can always override the dependency version using your package manager settings. Although, this might not be safe because we generate types for specific versions of the plugins, so the actual options of the rules might be different.
432
+
433
+ ### How do I know how eslint-config-un configures rules?
434
+
435
+ It's too much to document, so please have a look at the source code of our config. All the configs are placed inside `src/configs` directory.
436
+
437
+ ### How does exactly eslint-config-un knows if some package is installed?
438
+
439
+ We use [`local-pkg`](https://npmjs.com/local-pkg) package to detect if a package is installed.
440
+
441
+ ### How can I know which configs will be enabled, for which rules autofix will be disabled, etc.?
442
+
443
+ You can enable the debug mode by setting `DEBUG=eslint-config-un` environment variable when running ESLint command.
444
+
445
+ Alternatively, you can use [`@eslint/config-inspector`](https://npmjs.com/package/@eslint/config-inspector) to inspect the final config.
446
+
447
+ ## Troubleshooting & caveats
102
448
 
103
449
  ### TypeError: Key `languageOptions`: Key `globals`: Global `AudioWorkletGlobalScope ` has leading or trailing whitespace.
104
450
 
105
- Install `globals` package as a dev dependency.
451
+ Install `globals` package as a dev dependency.
452
+
453
+ ### Some dependencies are [bundled with `bundleDependencies` feature](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bundledependencies)
454
+
455
+ If you would like not to wait until the dependencies of `eslint-config-un` are updated or by whatever other reason you need to install a different version of a dependency, you can do that using your package manager's settings for all but the following packages:
456
+
457
+ | Package name | Reason |
458
+ | ------------ | ------ |
459
+ | [`eslint-plugin-prettier`](https://npmjs.com/eslint-plugin-prettier) | Patched by us to enable formatting of "fenced code blocks" inside Markdown files |
460
+ | [`eslint-plugin-no-type-assertion`](https://npmjs.com/eslint-plugin-no-type-assertion) | Has outdated requirements of peer dependencies |
461
+ | [`@angular-eslint/eslint-plugin-template@17.5.3`](https://npmjs.com/package/@angular-eslint/eslint-plugin-template/v/17.5.3) | Old version with outdated requirements of peer dependencies |
462
+ | [`@angular-eslint/eslint-plugin@18.4.3`](https://npmjs.com/package/@angular-eslint/eslint-plugin-template/v/18.4.3) | ^ |