Skip to content

Commit

Permalink
feat: add Solid-js Support
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
aminya committed Mar 5, 2024
1 parent 8f48bd2 commit 6bfc2ae
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"cSpell.words": ["globify"]
"cSpell.words": ["globify"],
"explorer.fileNesting.patterns": {
"index.js": "*.js"
}
}
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,26 @@ Add a lint script to your `package.json`:
}
```

- **solid**:
You can instead use the `solid` version which throws errors instead of warning:

```json
{
"extends": "eslint-config-atomic/solid",
"ignorePatterns": ["dist/", "node_modules/"]
}
```

- **strict-solid**:
Same as the solid version but it is strict:

```json
{
"extends": "eslint-config-atomic/strict-solid",
"ignorePatterns": ["dist/", "node_modules/"]
}
```

- **react**:
It supports react using `eslint-plugin-react`.

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"eslint-plugin-only-warn": "npm:@aminya/eslint-plugin-only-warn@^1.2.2",
"eslint-plugin-optimize-regex": "^1.2.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-solid": "^0.13.1",
"eslint-plugin-yaml": "^0.5.0",
"globify-gitignore": "^1.0.3",
"make-synchronous": "^0.1.1",
Expand Down
51 changes: 51 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions solid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("./dist/index-solid.cjs").default
21 changes: 21 additions & 0 deletions src/index-solid.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import base from "./index.cjs"
import { tsConfig } from "./typescript.cjs"

const nonStrictConfig = {
...base,
plugins: ["solid", ...base.plugins],
extends: ["plugin:solid/recommended", ...base.extends],
overrides: [
// TypeScript:
{
...tsConfig,
plugins: ["solid", ...tsConfig.plugins],
extends: ["plugin:solid/typescript", ...tsConfig.extends],
rules: tsConfig.rules,
},
// The rest is the same
...base.overrides.slice(1),
],
}

export default nonStrictConfig
15 changes: 15 additions & 0 deletions src/index-strict-solid.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import nonStrictConfig from "./index-solid.cjs"

// remove only-warn from javascript
if (nonStrictConfig.plugins[nonStrictConfig.plugins.length - 1] === "only-warn") {
nonStrictConfig.plugins.pop()
}

// remove only-warn from overrides
nonStrictConfig.overrides.forEach((overrides) => {
if (overrides.plugins[overrides.plugins.length - 1] === "only-warn") {
overrides.plugins.pop()
}
})

export default nonStrictConfig
1 change: 1 addition & 0 deletions strict-solid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("./dist/index-strict-solid.cjs").default

0 comments on commit 6bfc2ae

Please sign in to comment.