@blockquote/eslint-config 0.1.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.
- package/README.md +84 -0
- package/package.json +99 -0
- package/src/base.d.ts +1290 -0
- package/src/base.js +23 -0
- package/src/config.d.ts +6 -0
- package/src/config.js +47 -0
- package/src/html.d.ts +44 -0
- package/src/html.js +39 -0
- package/src/ignores.d.ts +3 -0
- package/src/ignores.js +26 -0
- package/src/import-x.d.ts +27 -0
- package/src/import-x.js +68 -0
- package/src/index.d.ts +19 -0
- package/src/index.js +21 -0
- package/src/lit-a11y.d.ts +9 -0
- package/src/lit-a11y.js +21 -0
- package/src/lit.d.ts +12 -0
- package/src/lit.js +23 -0
- package/src/rules.d.ts +12 -0
- package/src/rules.js +14 -0
- package/src/test.d.ts +7 -0
- package/src/test.js +14 -0
- package/src/typescript.d.ts +16 -0
- package/src/typescript.js +52 -0
- package/src/wc.d.ts +8 -0
- package/src/wc.js +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# @blockquote/eslint-config
|
|
2
|
+
|
|
3
|
+
Shared ESLint flat config for blockquote-web-components (Lit / Web Components).
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js >= 20.11 (for `import.meta.dirname`)
|
|
8
|
+
- ESLint >= 9 (flat config)
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm install --save-dev @blockquote/eslint-config
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Create an `eslint.config.js` at the project root:
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { defineConfig } from 'eslint/config';
|
|
22
|
+
import createConfig from '@blockquote/eslint-config';
|
|
23
|
+
|
|
24
|
+
export default defineConfig(createConfig());
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
That's it. When linting from the project root, `tsconfigRootDir` is not needed: it defaults to the current working directory.
|
|
28
|
+
|
|
29
|
+
### With `import.meta.dirname`
|
|
30
|
+
|
|
31
|
+
When the config lives in a different directory than the one you lint from (monorepos, subdirectories, CI), pass the config directory explicitly:
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
import { defineConfig } from 'eslint/config';
|
|
35
|
+
import createConfig from '@blockquote/eslint-config';
|
|
36
|
+
|
|
37
|
+
export default defineConfig(
|
|
38
|
+
createConfig({ tsconfigRootDir: import.meta.dirname }),
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`import.meta.dirname` is the directory of `eslint.config.js` (ESM, Node.js >= 20.11). When the option is omitted, `tsconfigRootDir` is not added to the config and ESLint uses `process.cwd()`.
|
|
43
|
+
|
|
44
|
+
## What's included
|
|
45
|
+
|
|
46
|
+
The preset builds on ESLint's recommended configs and adds:
|
|
47
|
+
|
|
48
|
+
- `@eslint/js` recommended rules
|
|
49
|
+
- `typescript-eslint` strict + stylistic rules (type-aware, via `projectService`)
|
|
50
|
+
- `eslint-plugin-import-x` (resolution, extensions, extraneous dependencies)
|
|
51
|
+
- `eslint-plugin-lit`, `eslint-plugin-lit-a11y`, `eslint-plugin-wc`
|
|
52
|
+
- `@html-eslint` rules
|
|
53
|
+
- `globals` for browser, ES2023 and mocha
|
|
54
|
+
- `eslint-config-prettier` (disable style rules, keep formatting to Prettier)
|
|
55
|
+
|
|
56
|
+
## Advanced
|
|
57
|
+
|
|
58
|
+
The individual pieces are also available as named exports and subpaths for fine-grained composition:
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
import createConfig, {
|
|
62
|
+
createImportFilesConfig,
|
|
63
|
+
createTsFilesConfig,
|
|
64
|
+
baseConfig,
|
|
65
|
+
testFilesRules,
|
|
66
|
+
} from '@blockquote/eslint-config';
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
@blockquote/eslint-config/ignores
|
|
71
|
+
@blockquote/eslint-config/base
|
|
72
|
+
@blockquote/eslint-config/import-x
|
|
73
|
+
@blockquote/eslint-config/typescript
|
|
74
|
+
@blockquote/eslint-config/html
|
|
75
|
+
@blockquote/eslint-config/lit
|
|
76
|
+
@blockquote/eslint-config/lit-a11y
|
|
77
|
+
@blockquote/eslint-config/wc
|
|
78
|
+
@blockquote/eslint-config/rules
|
|
79
|
+
@blockquote/eslint-config/test
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blockquote/eslint-config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared ESLint flat config for blockquote-web-components",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"eslint",
|
|
7
|
+
"flat-config",
|
|
8
|
+
"blockquote",
|
|
9
|
+
"web-components",
|
|
10
|
+
"lit"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/oscarmarina/eslint-config.git"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "Oscar Marina",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./src/index.d.ts",
|
|
22
|
+
"import": "./src/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./index.js": {
|
|
25
|
+
"types": "./src/index.d.ts",
|
|
26
|
+
"import": "./src/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./ignores": {
|
|
29
|
+
"types": "./src/ignores.d.ts",
|
|
30
|
+
"import": "./src/ignores.js"
|
|
31
|
+
},
|
|
32
|
+
"./base": {
|
|
33
|
+
"types": "./src/base.d.ts",
|
|
34
|
+
"import": "./src/base.js"
|
|
35
|
+
},
|
|
36
|
+
"./import-x": {
|
|
37
|
+
"types": "./src/import-x.d.ts",
|
|
38
|
+
"import": "./src/import-x.js"
|
|
39
|
+
},
|
|
40
|
+
"./lit-a11y": {
|
|
41
|
+
"types": "./src/lit-a11y.d.ts",
|
|
42
|
+
"import": "./src/lit-a11y.js"
|
|
43
|
+
},
|
|
44
|
+
"./wc": {
|
|
45
|
+
"types": "./src/wc.d.ts",
|
|
46
|
+
"import": "./src/wc.js"
|
|
47
|
+
},
|
|
48
|
+
"./lit": {
|
|
49
|
+
"types": "./src/lit.d.ts",
|
|
50
|
+
"import": "./src/lit.js"
|
|
51
|
+
},
|
|
52
|
+
"./typescript": {
|
|
53
|
+
"types": "./src/typescript.d.ts",
|
|
54
|
+
"import": "./src/typescript.js"
|
|
55
|
+
},
|
|
56
|
+
"./html": {
|
|
57
|
+
"types": "./src/html.d.ts",
|
|
58
|
+
"import": "./src/html.js"
|
|
59
|
+
},
|
|
60
|
+
"./rules": {
|
|
61
|
+
"types": "./src/rules.d.ts",
|
|
62
|
+
"import": "./src/rules.js"
|
|
63
|
+
},
|
|
64
|
+
"./test": {
|
|
65
|
+
"types": "./src/test.d.ts",
|
|
66
|
+
"import": "./src/test.js"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"files": [
|
|
70
|
+
"src"
|
|
71
|
+
],
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "tsc",
|
|
74
|
+
"test": "echo \"No tests\""
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"@eslint/js": "^10.0.1",
|
|
78
|
+
"@html-eslint/eslint-plugin": "^0.64.0",
|
|
79
|
+
"@html-eslint/parser": "^0.64.0",
|
|
80
|
+
"eslint-config-prettier": "^10.1.8",
|
|
81
|
+
"eslint-plugin-html": "^8.1.4",
|
|
82
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
83
|
+
"eslint-plugin-lit": "^2.3.1",
|
|
84
|
+
"eslint-plugin-lit-a11y": "^5.1.1",
|
|
85
|
+
"eslint-plugin-wc": "^3.1.0",
|
|
86
|
+
"globals": "^17.11.0",
|
|
87
|
+
"typescript-eslint": "^8.67.0"
|
|
88
|
+
},
|
|
89
|
+
"devDependencies": {
|
|
90
|
+
"eslint": "^10.8.1",
|
|
91
|
+
"typescript": "^6.0.3"
|
|
92
|
+
},
|
|
93
|
+
"peerDependencies": {
|
|
94
|
+
"eslint": "^10.0.0"
|
|
95
|
+
},
|
|
96
|
+
"publishConfig": {
|
|
97
|
+
"access": "public"
|
|
98
|
+
}
|
|
99
|
+
}
|