-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change basic configuration of
eslint
and prettier
- Loading branch information
1 parent
a0d234b
commit fd7c0ef
Showing
20 changed files
with
3,902 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
build |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react", | ||
"@typescript-eslint", | ||
"react-hooks", | ||
"jsx-a11y", | ||
"import", | ||
"prettier" | ||
], | ||
"rules": { | ||
"react/react-in-jsx-scope": "off", | ||
"react/prop-types": "off", | ||
"prettier/prettier": "error", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ "argsIgnorePattern": "^_" } | ||
], | ||
"react-hooks/rules-of-hooks": "error", | ||
"react-hooks/exhaustive-deps": "warn", | ||
"jsx-a11y/anchor-is-valid": "warn", | ||
"import/order": [ | ||
"error", | ||
{ | ||
"groups": ["builtin", "external", "internal"], | ||
"pathGroups": [ | ||
{ | ||
"pattern": "react", | ||
"group": "external", | ||
"position": "before" | ||
} | ||
], | ||
"pathGroupsExcludedImportTypes": ["react"], | ||
"newlines-between": "always", | ||
"alphabetize": { | ||
"order": "asc", | ||
"caseInsensitive": true | ||
} | ||
} | ||
] | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Basic Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
formatting_tests: | ||
name: Formatting Tests | ||
if: github.base_ref != 'develop' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '21' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Test Prettier | ||
run: | | ||
npx prettier --check --config .prettierrc --log-level warn . | ||
- name: Test ESLint | ||
run: | | ||
npx eslint --color --max-warnings 0 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ dist-ssr | |
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
{ | ||
"extends": ["@commitlint/config-conventional"], | ||
"rules": { | ||
"type-enum": [ | ||
2, | ||
"always", | ||
[ | ||
"feat", | ||
"fix" | ||
] | ||
] | ||
"type-enum": [2, "always", ["feat", "fix"]] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit | ||
npx --no-install commitlint --edit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run prepare | ||
npx lint-staged | ||
npm run check-branch-name | ||
npm run check-branch-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"endOfLine": "lf", | ||
"endOfLine": "auto", | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "es5" | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"mhutchie.git-graph", | ||
"eamodio.gitlens", | ||
"PKief.material-icon-theme", | ||
"esbenp.prettier-vscode", | ||
"Tyriar.sort-lines", | ||
"ChakrounAnas.turbo-console-log", | ||
"dsznajder.es7-react-js-snippets", | ||
"zhang-renyang.vscode-react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# Univent Planner Frontend | ||
# Univent Planner Frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const expectedTypes = ['fix', 'feat']; | ||
|
||
module.exports = { | ||
// extends: ['@commitlint/config-conventional'], | ||
plugins: [ | ||
{ | ||
rules: { | ||
'custom-type-enum': ({ type }) => { | ||
if (!expectedTypes.includes(type)) { | ||
return [ | ||
false, | ||
`Type must be one of: ${expectedTypes.join(', ')} \nExample: feat: add new feature`, | ||
]; | ||
} | ||
return [true]; | ||
}, | ||
}, | ||
}, | ||
], | ||
rules: { | ||
'custom-type-enum': [2, 'always'], | ||
}, | ||
}; |
Oops, something went wrong.