add linter

This commit is contained in:
hazycora 2023-08-02 17:17:01 -05:00
parent 28906bfb80
commit d684ad6045
No known key found for this signature in database
GPG key ID: 215AF1F81F86940E
6 changed files with 1091 additions and 22 deletions

28
.eslintrc.cjs Normal file
View file

@ -0,0 +1,28 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'prettier', 'plugin:unicorn/recommended'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2022
},
env: {
browser: true,
es2017: true,
node: true
},
plugins: ['unicorn'],
rules: {
'no-var': 'error',
'prefer-const': 'error',
quotes: ['error', 'single', { avoidEscape: true }],
'quote-props': ['error', 'as-needed'],
'no-constant-condition': ['error', { checkLoops: false }],
'no-duplicate-imports': 'error',
'no-inner-declarations': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-string-replace-all': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/template-indent': 'off',
'unicorn/no-nested-ternary': 'off'
}
}