@murky-web/oxc-config 0.1.2 → 0.2.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/.oxlintrc.base.jsonc +28 -0
- package/.oxlintrc.jsonc +15 -22
- package/README.md +28 -3
- package/linting/import.jsonc +5 -2
- package/linting/murky.jsonc +14 -0
- package/linting/unicorn.jsonc +3 -0
- package/package.json +10 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"extends": [
|
|
4
|
+
"./linting/base.jsonc",
|
|
5
|
+
"./linting/eslint.jsonc",
|
|
6
|
+
"./linting/typescript.jsonc",
|
|
7
|
+
"./linting/unicorn.jsonc",
|
|
8
|
+
"./linting/oxc.jsonc",
|
|
9
|
+
"./linting/import.jsonc",
|
|
10
|
+
"./linting/jsx_a11y.jsonc",
|
|
11
|
+
"./linting/vitest.jsonc",
|
|
12
|
+
"./linting/promise.jsonc",
|
|
13
|
+
"./linting/node.jsonc",
|
|
14
|
+
"./linting/jsdoc.jsonc"
|
|
15
|
+
],
|
|
16
|
+
"plugins": [
|
|
17
|
+
"eslint",
|
|
18
|
+
"typescript",
|
|
19
|
+
"unicorn",
|
|
20
|
+
"oxc",
|
|
21
|
+
"import",
|
|
22
|
+
"jsx-a11y",
|
|
23
|
+
"vitest",
|
|
24
|
+
"promise",
|
|
25
|
+
"node",
|
|
26
|
+
"jsdoc"
|
|
27
|
+
]
|
|
28
|
+
}
|
package/.oxlintrc.jsonc
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "../../node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
// The full stack: the built-in rules from .oxlintrc.base.jsonc plus the
|
|
4
|
+
// rules of the four @murky-web plugins. An app extends only this file and
|
|
5
|
+
// adds its own rules. The plugins are dependencies of this package and
|
|
6
|
+
// resolve from here. Packages of this repo that the stack depends on
|
|
7
|
+
// (typebuddy, simplelog) extend .oxlintrc.base.jsonc instead.
|
|
3
8
|
"extends": [
|
|
4
|
-
"
|
|
5
|
-
"./linting/
|
|
6
|
-
"./linting/
|
|
7
|
-
"./linting/
|
|
8
|
-
"./linting/
|
|
9
|
-
"./linting/import.jsonc",
|
|
10
|
-
"./linting/jsx_a11y.jsonc",
|
|
11
|
-
"./linting/vitest.jsonc",
|
|
12
|
-
"./linting/promise.jsonc",
|
|
13
|
-
"./linting/node.jsonc",
|
|
14
|
-
"./linting/jsdoc.jsonc"
|
|
9
|
+
"./.oxlintrc.base.jsonc",
|
|
10
|
+
"./linting/murky.jsonc",
|
|
11
|
+
"./linting/solid.jsonc",
|
|
12
|
+
"./linting/typebuddy.jsonc",
|
|
13
|
+
"./linting/simplelog.jsonc"
|
|
15
14
|
],
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"import",
|
|
22
|
-
"jsx-a11y",
|
|
23
|
-
"vitest",
|
|
24
|
-
"promise",
|
|
25
|
-
"node",
|
|
26
|
-
"jsdoc"
|
|
15
|
+
"jsPlugins": [
|
|
16
|
+
"@murky-web/oxlint-plugin",
|
|
17
|
+
"@murky-web/oxlint-plugin-solid",
|
|
18
|
+
"@murky-web/typebuddy/oxlint",
|
|
19
|
+
"@murky-web/simplelog/oxlint"
|
|
27
20
|
]
|
|
28
21
|
}
|
package/README.md
CHANGED
|
@@ -10,18 +10,43 @@ oxfmt -c ./node_modules/@murky-web/oxc-config/.oxfmtrc.jsonc .
|
|
|
10
10
|
|
|
11
11
|
## oxlint
|
|
12
12
|
|
|
13
|
+
An app extends one file and adds only its own rules and overrides:
|
|
14
|
+
|
|
13
15
|
```jsonc
|
|
14
16
|
// .oxlintrc.jsonc
|
|
15
17
|
{
|
|
16
|
-
"extends": ["./node_modules/@murky-web/oxc-config/.oxlintrc.jsonc"]
|
|
18
|
+
"extends": ["./node_modules/@murky-web/oxc-config/.oxlintrc.jsonc"],
|
|
19
|
+
"rules": {
|
|
20
|
+
// project rules and overrides
|
|
21
|
+
}
|
|
17
22
|
}
|
|
18
23
|
```
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
`.oxlintrc.jsonc` is the full stack: the built-in plugins (eslint, typescript,
|
|
26
|
+
unicorn, oxc, import, jsx-a11y, vitest, promise, node, jsdoc) and the rules of
|
|
27
|
+
the four `@murky-web` JS plugins, which it loads itself through `jsPlugins`.
|
|
28
|
+
They are dependencies of this package, so installing it installs them:
|
|
22
29
|
|
|
23
30
|
| File | Plugin |
|
|
24
31
|
| ------------------------- | -------------------------------- |
|
|
32
|
+
| `linting/murky.jsonc` | `@murky-web/oxlint-plugin` |
|
|
25
33
|
| `linting/solid.jsonc` | `@murky-web/oxlint-plugin-solid` |
|
|
26
34
|
| `linting/typebuddy.jsonc` | `@murky-web/typebuddy/oxlint` |
|
|
27
35
|
| `linting/simplelog.jsonc` | `@murky-web/simplelog/oxlint` |
|
|
36
|
+
|
|
37
|
+
The type-aware rules need `oxlint-tsgolint` in the project; it is a peer
|
|
38
|
+
dependency (`>=7.0.2007`, the range oxlint itself names), so install it next to
|
|
39
|
+
`oxlint`.
|
|
40
|
+
|
|
41
|
+
### Base entry for libraries
|
|
42
|
+
|
|
43
|
+
A package the stack depends on (typebuddy, simplelog in this repo) cannot load
|
|
44
|
+
its own plugin before it is built. It extends `.oxlintrc.base.jsonc`, the
|
|
45
|
+
built-in plugins only, and adds single rule files from `linting/` with their
|
|
46
|
+
plugin in its own `jsPlugins` when it wants them:
|
|
47
|
+
|
|
48
|
+
```jsonc
|
|
49
|
+
{
|
|
50
|
+
"extends": ["./node_modules/@murky-web/oxc-config/.oxlintrc.base.jsonc"]
|
|
51
|
+
}
|
|
52
|
+
```
|
package/linting/import.jsonc
CHANGED
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
"import/consistent-type-specifier-style": "error",
|
|
4
4
|
"import/default": "error",
|
|
5
5
|
"import/export": "error",
|
|
6
|
-
|
|
6
|
+
// Exports stay at the declaration (`export function a() {}`): the
|
|
7
|
+
// reader sees at once what is public, and a rename or deletion needs
|
|
8
|
+
// no export list kept in step. No major preset turns these on.
|
|
9
|
+
"import/exports-last": "off",
|
|
7
10
|
"import/extensions": "error",
|
|
8
11
|
"import/first": "error",
|
|
9
|
-
"import/group-exports": "
|
|
12
|
+
"import/group-exports": "off",
|
|
10
13
|
"import/max-dependencies": "off",
|
|
11
14
|
"import/named": "error",
|
|
12
15
|
"import/namespace": "error",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Generic rules from @murky-web/oxlint-plugin (prefix murky); needs the
|
|
3
|
+
// plugin in your own jsPlugins.
|
|
4
|
+
"rules": {
|
|
5
|
+
// Replaces unicorn/prefer-string-raw (unicorn.jsonc) wherever this
|
|
6
|
+
// file is extended, so a literal is reported once.
|
|
7
|
+
"unicorn/prefer-string-raw": "off",
|
|
8
|
+
// unicorn's rule plus the module-load exception: inside a function
|
|
9
|
+
// "a\\b" becomes String.raw`a\b`; at module load the plain literal
|
|
10
|
+
// stays and String.raw is reported, because a bundler cannot drop the
|
|
11
|
+
// tagged-template call from client chunks when the value is unused.
|
|
12
|
+
"murky/prefer-string-raw": "error"
|
|
13
|
+
}
|
|
14
|
+
}
|
package/linting/unicorn.jsonc
CHANGED
|
@@ -115,6 +115,9 @@
|
|
|
115
115
|
"unicorn/prefer-set-has": "error",
|
|
116
116
|
"unicorn/prefer-set-size": "error",
|
|
117
117
|
"unicorn/prefer-spread": "error",
|
|
118
|
+
// murky.jsonc replaces this rule with murky/prefer-string-raw, which
|
|
119
|
+
// keeps plain literals at module load (String.raw there is a call a
|
|
120
|
+
// bundler cannot drop); projects without it keep this one.
|
|
118
121
|
"unicorn/prefer-string-raw": "error",
|
|
119
122
|
"unicorn/prefer-string-replace-all": "error",
|
|
120
123
|
"unicorn/prefer-string-slice": "error",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@murky-web/oxc-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Shared oxfmt and oxlint configuration",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
".oxfmtrc.jsonc",
|
|
13
|
+
".oxlintrc.base.jsonc",
|
|
13
14
|
".oxlintrc.jsonc",
|
|
14
15
|
"linting",
|
|
15
16
|
"README.md"
|
|
@@ -21,8 +22,15 @@
|
|
|
21
22
|
"scripts": {
|
|
22
23
|
"test": "bun ./check_prefixes.mjs"
|
|
23
24
|
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@murky-web/oxlint-plugin": "^0.1.0",
|
|
27
|
+
"@murky-web/oxlint-plugin-solid": "^1.7.0",
|
|
28
|
+
"@murky-web/simplelog": "^3.1.2",
|
|
29
|
+
"@murky-web/typebuddy": "^3.1.0"
|
|
30
|
+
},
|
|
24
31
|
"peerDependencies": {
|
|
25
32
|
"oxfmt": ">=0.79.0",
|
|
26
|
-
"oxlint": ">=1.94.0"
|
|
33
|
+
"oxlint": ">=1.94.0",
|
|
34
|
+
"oxlint-tsgolint": ">=7.0.2007"
|
|
27
35
|
}
|
|
28
36
|
}
|