Skip to content

Commit

Permalink
enhancement-506: configure eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanPostu committed Sep 16, 2024
1 parent d74ac66 commit 9f9aace
Show file tree
Hide file tree
Showing 5 changed files with 1,259 additions and 50 deletions.
26 changes: 0 additions & 26 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc
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,
Expand Down
35 changes: 35 additions & 0 deletions eslint.config.mjs
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'
}
}
];
Loading

0 comments on commit 9f9aace

Please sign in to comment.