eslint-config-un 0.0.2
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/LICENSE.md +21 -0
- package/README.md +57 -0
- package/dist/index.cjs +2315 -0
- package/dist/index.d.cts +188 -0
- package/dist/index.d.ts +188 -0
- package/dist/index.js +2303 -0
- package/package.json +94 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 andreww2012
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# eslint-config-un
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/esling-config-un)
|
|
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.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
npm i -D eslint-config-un
|
|
11
|
+
pnpm i -D eslint-config-un
|
|
12
|
+
yarn add -D eslint-config-un
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## List of configs
|
|
16
|
+
|
|
17
|
+
Includes the following rules, configs & plugins:
|
|
18
|
+
- [Vanilla ESLint rules](https://eslint.org/docs/latest/rules/)
|
|
19
|
+
- [typescript-eslint](https://typescript-eslint.io/rules/)
|
|
20
|
+
- [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))
|
|
21
|
+
- [unicorn](https://www.npmjs.com/package/eslint-plugin-unicorn)
|
|
22
|
+
- [node](https://www.npmjs.com/package/eslint-plugin-n) (`eslint-plugin-n` with `node` prefix)
|
|
23
|
+
- [import](https://www.npmjs.com/package/eslint-plugin-import-x) (`eslint-plugin-import-x` with `import` prefix)
|
|
24
|
+
- [promise](https://www.npmjs.com/package/eslint-plugin-promise)
|
|
25
|
+
- [regexp](https://www.npmjs.com/package/eslint-plugin-regexp)
|
|
26
|
+
- [security](https://www.npmjs.com/package/eslint-plugin-security)
|
|
27
|
+
- [sonar](https://www.npmjs.com/package/eslint-plugin-sonarjs)
|
|
28
|
+
- [tailwind](https://www.npmjs.com/package/eslint-plugin-tailwindcss)
|
|
29
|
+
- [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier) to disable Prettier-incompatible rules
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
- Automatically detects the presence of `typescript`, `vue`, `nuxt` and `pinia` packages and enables corresponding configurations (which can also be enabled or disabled explicitly).
|
|
34
|
+
- Every block of rules supports `overrides` for rules.
|
|
35
|
+
- Designed to be used separately from Prettier: *almost* all the rules potentially conflicting with Prettier are disabled *by default*.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
In your `eslint.config.[cm]?js`:
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
// @ts-check
|
|
43
|
+
import {eslintConfig} from 'eslint-config-un';
|
|
44
|
+
|
|
45
|
+
export default eslintConfig({
|
|
46
|
+
// your configuration (optional)
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Limitations & Caveats
|
|
51
|
+
|
|
52
|
+
- 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.
|
|
53
|
+
- Packages lookup (such as `typescript` or `vue`) is performed using [`local-pkg`](https://www.npmjs.com/package/local-pkg).
|
|
54
|
+
- 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).
|
|
55
|
+
- By default, TypeScript rules will only 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. This is because right now it is not possible to apply different rules based on `lang` attribute of `<script>` SFC sections and the only reasonable solution would be to completely disable TypeScript rules to avoid great number of false positives.
|
|
56
|
+
- All plugins listed above are enabled by default or enabled automatically under certain conditions, but there is one that is *disabled* by default: `security`.
|
|
57
|
+
- 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 this plugin's source code.
|