Skip to content

Commit

Permalink
feat: support solid
Browse files Browse the repository at this point in the history
  • Loading branch information
ModyQyW committed May 30, 2023
1 parent d03e37e commit d5bc9e1
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-node": "^0.3.7",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-check-file": "^2.3.0",
"eslint-plugin-import": "npm:eslint-plugin-i",
"eslint-plugin-jsonc": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
Expand All @@ -121,6 +122,7 @@
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-react-native-a11y": "^3.3.0",
"eslint-plugin-regexp": "^1.15.0",
"eslint-plugin-solid": "^0.12.1",
"eslint-plugin-unicorn": "^47.0.0",
"eslint-plugin-vue": "^9.13.0",
"eslint-plugin-vue-scoped-css": "^2.4.0",
Expand Down
66 changes: 66 additions & 0 deletions pnpm-lock.yaml

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

6 changes: 6 additions & 0 deletions src/eslint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
enableNext,
enableReactNative,
enableReact,
enableSolid,
enableMiniprogram,
enablePrettier,
} from '../helpers';
Expand Down Expand Up @@ -97,6 +98,11 @@ const config: Linter.Config = {
enableReactNative ? 'plugin:react-native/all' : '',
enableReactNative ? 'plugin:react-native-a11y/all' : '',
enableNext ? 'next/core-web-vitals' : '',
enableSolid
? enableTypeScript
? 'plugin:solid/typescript'
: 'plugin:solid/recommended'
: '',
enablePrettier ? 'plugin:prettier/recommended' : '',
].filter((item) => !!item),
rules: reactRules,
Expand Down
2 changes: 2 additions & 0 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const enableReactNative =
export const enableReact =
isPackageExists('react') || Boolean(process.env.ENABLE_REACT) || enableNext || enableReactNative;

export const enableSolid = isPackageExists('solid-js') || Boolean(process.env.ENABLE_SOLID);

export const enableMiniprogram =
isPackageExists('@dcloudio/vite-plugin-uni') ||
isPackageExists('@dcloudio/vue-cli-plugin-uni') ||
Expand Down

0 comments on commit d5bc9e1

Please sign in to comment.