Skip to content

Commit

Permalink
4 configure linting (#12)
Browse files Browse the repository at this point in the history
* create eslint from template

* ignore build

* configure plugin and fix an issue

* use old config instead of crippy old one

* correct github action

* fix eslint resolver error

* fix eslint issues

* fix eslint issues
  • Loading branch information
siavol authored Jun 30, 2024
1 parent c109d7e commit 90596b5
Show file tree
Hide file tree
Showing 18 changed files with 875 additions and 326 deletions.
44 changes: 44 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:import/recommended"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [ "react", "@typescript-eslint", "react-hooks" ],
"rules": {
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [ "error" ],
"react/jsx-filename-extension": [ "warn", { "extensions": [ ".tsx" ] } ],
"import/extensions": [ "error", "ignorePackages", { "ts": "never", "tsx": "never" } ],
"no-shadow": "off",
"@typescript-eslint/no-shadow": [ "error" ],
"@typescript-eslint/explicit-function-return-type": [ "error", { "allowExpressions": true } ],
"max-len": [ "warn", { "code": 100, "ignoreComments": true, "ignoreUrls": true } ],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"import/prefer-default-export": "off",
"react/prop-types": "off",
"prettier/prettier": [ "error", { "endOfLine": "auto" } ]
},
"settings": {
"import/resolver": {
"typescript": {}
}
}
}
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Run eslint
run: npm run lint

- name: Run tests
run: npm test

Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
Loading

0 comments on commit 90596b5

Please sign in to comment.