@0xposed/eslint-config 0.1.0 → 0.1.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/LICENSE +12 -0
- package/README.md +63 -52
- package/package.json +24 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
|
2
|
+
Version 2, December 2004
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
|
5
|
+
|
|
6
|
+
Everyone is permitted to copy and distribute verbatim or modified copies of
|
|
7
|
+
this license document, and changing it is allowed as long as the name is changed.
|
|
8
|
+
|
|
9
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
|
10
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
11
|
+
|
|
12
|
+
0. You just DO WHAT THE FUCK YOU WANT TO.
|
package/README.md
CHANGED
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
ESLint
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
<h1 align="center">@0xposed/eslint-config</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">ESLint flat presets for JavaScript, TypeScript, Node.js, and Svelte.</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a aria-label="Version" href="https://www.npmjs.com/package/@0xposed/eslint-config">
|
|
7
|
+
<img alt="Version" src="https://img.shields.io/npm/v/@0xposed/eslint-config?style=flat&color=000&logoColor=000">
|
|
8
|
+
</a>
|
|
9
|
+
<a aria-label="License" href="https://github.com/0xposed/configurations/blob/master/LICENSE">
|
|
10
|
+
<img alt="License" src="https://img.shields.io/github/license/0xposed/configurations?style=flat&color=000000">
|
|
11
|
+
</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
ESLint 9 flat configurations for JavaScript, TypeScript 5, and Svelte 5.
|
|
15
|
+
Requires Node 20.19+.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
pnpm add -D @0xposed/eslint-config eslint@^9 typescript@^5
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Create `eslint.config.mjs`:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
export { default } from '@0xposed/eslint-config';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Presets
|
|
28
|
+
|
|
29
|
+
| Import | Environment |
|
|
30
|
+
| ----------------------------------- | ---------------------------------------------- |
|
|
31
|
+
| `@0xposed/eslint-config` or `/node` | Node.js globals |
|
|
32
|
+
| `@0xposed/eslint-config/base` | No environment globals |
|
|
33
|
+
| `@0xposed/eslint-config/svelte` | Svelte/SvelteKit with browser and Node globals |
|
|
34
|
+
|
|
35
|
+
All presets include recommended JavaScript and TypeScript rules, Perfectionist's
|
|
36
|
+
natural import sorting, unused-import checks, and Prettier compatibility. Variables
|
|
37
|
+
and arguments starting with `_` are allowed to be unused. `no-undef` remains
|
|
38
|
+
enabled for JavaScript and is disabled for TypeScript; run your TypeScript or
|
|
39
|
+
Svelte checker for unresolved names in typed code.
|
|
40
|
+
No type-aware linting or `tsconfig.json` is required.
|
|
41
|
+
|
|
42
|
+
For Svelte, install `svelte@^5` in the consuming project and use:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
export { default } from '@0xposed/eslint-config/svelte';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Customize
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
import config from '@0xposed/eslint-config';
|
|
52
|
+
import sorting from '@0xposed/eslint-config/sorting';
|
|
53
|
+
|
|
54
|
+
export default [...config, sorting];
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The optional sorting preset enables all of Perfectionist's recommended natural
|
|
58
|
+
sorting rules, including objects and declarations. The default only sorts imports.
|
|
59
|
+
|
|
60
|
+
In a monorepo, put the appropriate config in each package and run ESLint from
|
|
61
|
+
each package directory (for example, `turbo lint` or `pnpm -r lint`). ESLint 9
|
|
62
|
+
does not select nested package configs when you run `eslint .` at the root.
|
|
63
|
+
Pre-commit commands must also run ESLint from the relevant package directory.
|
package/package.json
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xposed/eslint-config",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Shared ESLint flat configs for Node, TypeScript and Svelte projects.",
|
|
5
|
+
"author": "0xposed <0xposed@pm.me>",
|
|
6
|
+
"license": "WTFPL",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/0xposed/configurations.git",
|
|
10
|
+
"directory": "packages/eslint-config"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/0xposed/configurations/tree/master/packages/eslint-config#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/0xposed/configurations/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"0xposed",
|
|
18
|
+
"eslint",
|
|
19
|
+
"eslint-config",
|
|
20
|
+
"flat-config",
|
|
21
|
+
"javascript",
|
|
22
|
+
"typescript",
|
|
23
|
+
"nodejs",
|
|
24
|
+
"svelte",
|
|
25
|
+
"sveltekit"
|
|
26
|
+
],
|
|
5
27
|
"type": "module",
|
|
6
28
|
"main": "./node.js",
|
|
7
29
|
"exports": {
|
|
@@ -39,4 +61,4 @@
|
|
|
39
61
|
"globals": "^17.4.0",
|
|
40
62
|
"typescript-eslint": "^8.65.0"
|
|
41
63
|
}
|
|
42
|
-
}
|
|
64
|
+
}
|