ci: add eslint with prettier, with ts and mdx support

This commit is contained in:
Anthony Berg 2023-06-24 16:30:12 +01:00
parent 421746338b
commit 94dce3e277
6 changed files with 2498 additions and 2 deletions

View File

@ -1,3 +1,29 @@
{
"extends": "next/core-web-vitals"
"plugins": [
"@typescript-eslint"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals",
"plugin:mdx/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module",
"project": "tsconfig.json"
},
"settings": {
"mdx/code-blocks": true
},
"overrides": [
{
"files": ["*.mdx"],
"extends": "plugin:mdx/recommended"
}
]
}

View File

@ -38,7 +38,7 @@ jobs:
- name: Run ESLint
run: npx eslint .
--config .eslintrc.json
--ext .js,.jsx,.ts,.tsx,.mdx
--ext .js,.jsx,.ts,.tsx,.md,.mdx
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true

1
.prettierignore Normal file
View File

@ -0,0 +1 @@
node_modules

3
.prettierrc.json Normal file
View File

@ -0,0 +1,3 @@
{
"singleQuote": true
}

2458
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,5 +21,13 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "5.1.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-mdx": "^2.1.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "2.8.8"
}
}