fix: corrige erros do ESLint e configura variáveis globais
- Adiciona variáveis globais do Node.js (process, console, __dirname, require, module, exports) - Adiciona variáveis globais do Jest (describe, it, beforeEach, fail, etc.) - Configura ESLint para arquivos JavaScript de configuração - Remove diretivas eslint-disable não utilizadas - Corrige variáveis não usadas prefixando com _ - Ajusta regras do ESLint para ignorar variáveis que começam com _ - Formata código com Prettier
This commit is contained in:
@@ -18,6 +18,13 @@ module.exports = [
|
||||
globals: {
|
||||
node: true,
|
||||
jest: true,
|
||||
process: 'readonly',
|
||||
console: 'readonly',
|
||||
__dirname: 'readonly',
|
||||
__filename: 'readonly',
|
||||
require: 'readonly',
|
||||
module: 'readonly',
|
||||
exports: 'readonly',
|
||||
describe: 'readonly',
|
||||
it: 'readonly',
|
||||
test: 'readonly',
|
||||
@@ -26,6 +33,7 @@ module.exports = [
|
||||
afterEach: 'readonly',
|
||||
beforeAll: 'readonly',
|
||||
afterAll: 'readonly',
|
||||
fail: 'readonly',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
@@ -38,6 +46,17 @@ module.exports = [
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-require-imports': 'warn',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
caughtErrorsIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
'no-useless-escape': 'warn',
|
||||
'no-import-assign': 'off',
|
||||
'prettier/prettier': 'error',
|
||||
},
|
||||
},
|
||||
@@ -54,8 +73,37 @@ module.exports = [
|
||||
beforeAll: 'readonly',
|
||||
afterAll: 'readonly',
|
||||
jest: 'readonly',
|
||||
fail: 'readonly',
|
||||
require: 'readonly',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.js'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
node: true,
|
||||
jest: true,
|
||||
process: 'readonly',
|
||||
console: 'readonly',
|
||||
__dirname: 'readonly',
|
||||
__filename: 'readonly',
|
||||
require: 'readonly',
|
||||
module: 'readonly',
|
||||
exports: 'readonly',
|
||||
global: 'readonly',
|
||||
Buffer: 'readonly',
|
||||
},
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'commonjs',
|
||||
},
|
||||
rules: {
|
||||
'no-undef': 'off',
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
|
||||
|
||||
Reference in New Issue
Block a user