forked from Dogfalo/materialize
-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #507 from IvanPostu/enhancement-506
enhancement-506: Add eslint with prettier plugin and integrate it in preversion/release pipeline (Part 1 - config)
- Loading branch information
Showing
5 changed files
with
1,259 additions
and
50 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"printWidth": 100, | ||
"parser": "flow", | ||
"parser": "typescript", | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
|
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,35 @@ | ||
import typescriptEslint from 'typescript-eslint'; | ||
import prettierPlugin from 'eslint-plugin-prettier'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
|
||
export default [ | ||
{ | ||
files: ['src/**/*.{ts,js,mjs}'], | ||
ignores: ['dist', 'node_modules'] | ||
}, | ||
...typescriptEslint.configs.recommended, | ||
{ | ||
plugins: { | ||
prettier: prettierPlugin | ||
}, | ||
rules: { | ||
...prettierPlugin.configs.recommended.rules, | ||
...eslintConfigPrettier.rules, | ||
|
||
// TODO: to improve because the basic rules cause | ||
// thousands of errors, for this reason, they have been marked as WARN | ||
'prettier/prettier': 'warn', | ||
|
||
'prefer-const': 'warn', | ||
'prefer-rest-params': 'warn', | ||
'no-var': 'warn', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-unused-vars': 'warn', | ||
'@typescript-eslint/no-unused-expressions': 'warn', | ||
'@typescript-eslint/no-this-alias': 'warn', | ||
'@typescript-eslint/no-empty-object-type': 'warn', | ||
'@typescript-eslint/no-require-imports': 'warn', | ||
'@typescript-eslint/no-unsafe-function-type': 'warn' | ||
} | ||
} | ||
]; |
Oops, something went wrong.