Skip to content

Commit 6bfc2ae

Browse files
committed
feat: add Solid-js Support
Update README.md
1 parent 8f48bd2 commit 6bfc2ae

File tree

8 files changed

+114
-1
lines changed

8 files changed

+114
-1
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"cSpell.words": ["globify"]
2+
"cSpell.words": ["globify"],
3+
"explorer.fileNesting.patterns": {
4+
"index.js": "*.js"
5+
}
36
}

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@ Add a lint script to your `package.json`:
6060
}
6161
```
6262

63+
- **solid**:
64+
You can instead use the `solid` version which throws errors instead of warning:
65+
66+
```json
67+
{
68+
"extends": "eslint-config-atomic/solid",
69+
"ignorePatterns": ["dist/", "node_modules/"]
70+
}
71+
```
72+
73+
- **strict-solid**:
74+
Same as the solid version but it is strict:
75+
76+
```json
77+
{
78+
"extends": "eslint-config-atomic/strict-solid",
79+
"ignorePatterns": ["dist/", "node_modules/"]
80+
}
81+
```
82+
6383
- **react**:
6484
It supports react using `eslint-plugin-react`.
6585

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"eslint-plugin-only-warn": "npm:@aminya/eslint-plugin-only-warn@^1.2.2",
4444
"eslint-plugin-optimize-regex": "^1.2.1",
4545
"eslint-plugin-react": "^7.33.2",
46+
"eslint-plugin-solid": "^0.13.1",
4647
"eslint-plugin-yaml": "^0.5.0",
4748
"globify-gitignore": "^1.0.3",
4849
"make-synchronous": "^0.1.1",

pnpm-lock.yaml

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

solid.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("./dist/index-solid.cjs").default

src/index-solid.cts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import base from "./index.cjs"
2+
import { tsConfig } from "./typescript.cjs"
3+
4+
const nonStrictConfig = {
5+
...base,
6+
plugins: ["solid", ...base.plugins],
7+
extends: ["plugin:solid/recommended", ...base.extends],
8+
overrides: [
9+
// TypeScript:
10+
{
11+
...tsConfig,
12+
plugins: ["solid", ...tsConfig.plugins],
13+
extends: ["plugin:solid/typescript", ...tsConfig.extends],
14+
rules: tsConfig.rules,
15+
},
16+
// The rest is the same
17+
...base.overrides.slice(1),
18+
],
19+
}
20+
21+
export default nonStrictConfig

src/index-strict-solid.cts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import nonStrictConfig from "./index-solid.cjs"
2+
3+
// remove only-warn from javascript
4+
if (nonStrictConfig.plugins[nonStrictConfig.plugins.length - 1] === "only-warn") {
5+
nonStrictConfig.plugins.pop()
6+
}
7+
8+
// remove only-warn from overrides
9+
nonStrictConfig.overrides.forEach((overrides) => {
10+
if (overrides.plugins[overrides.plugins.length - 1] === "only-warn") {
11+
overrides.plugins.pop()
12+
}
13+
})
14+
15+
export default nonStrictConfig

strict-solid.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("./dist/index-strict-solid.cjs").default

0 commit comments

Comments
 (0)