chore: dev env linting...
This commit is contained in:
parent
c802350442
commit
8e84f32f5a
1 changed files with 80 additions and 82 deletions
|
@ -1,7 +1,7 @@
|
|||
import eslint from '@eslint/js';
|
||||
import nodePlugin from 'eslint-plugin-node';
|
||||
import securityPlugin from 'eslint-plugin-security';
|
||||
import prettierPlugin from 'eslint-plugin-prettier';
|
||||
import eslint from '@eslint/js'
|
||||
import nodePlugin from 'eslint-plugin-node'
|
||||
import securityPlugin from 'eslint-plugin-security'
|
||||
import prettierPlugin from 'eslint-plugin-prettier'
|
||||
|
||||
export default [
|
||||
eslint.configs.recommended,
|
||||
|
@ -12,17 +12,17 @@ export default [
|
|||
sourceType: 'module',
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
impliedStrict: true
|
||||
}
|
||||
impliedStrict: true,
|
||||
},
|
||||
},
|
||||
globals: {
|
||||
...nodePlugin.configs.recommended.globals,
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
node: nodePlugin,
|
||||
security: securityPlugin,
|
||||
prettier: prettierPlugin
|
||||
prettier: prettierPlugin,
|
||||
},
|
||||
rules: {
|
||||
// Modern JavaScript
|
||||
|
@ -36,13 +36,13 @@ export default [
|
|||
// Node.js specific rules
|
||||
// 'node/exports-style': ['error', 'exports'],
|
||||
'node/file-extension-in-import': ['error', 'always'],
|
||||
'node/prefer-global/buffer': ['error', 'always'],
|
||||
'node/prefer-global/console': ['error', 'always'],
|
||||
'node/prefer-global/process': ['error', 'always'],
|
||||
'node/prefer-global/url-search-params': ['error', 'always'],
|
||||
'node/prefer-global/url': ['error', 'always'],
|
||||
'node/prefer-promises/dns': 'error',
|
||||
'node/prefer-promises/fs': 'error',
|
||||
// 'node/prefer-global/buffer': ['error', 'always'],
|
||||
// 'node/prefer-global/console': ['error', 'always'],
|
||||
// 'node/prefer-global/process': ['error', 'always'],
|
||||
// 'node/prefer-global/url-search-params': ['error', 'always'],
|
||||
// 'node/prefer-global/url': ['error', 'always'],
|
||||
// 'node/prefer-promises/dns': 'error',
|
||||
// 'node/prefer-promises/fs': 'error',
|
||||
|
||||
// Security rules
|
||||
'security/detect-buffer-noassert': 'error',
|
||||
|
@ -60,28 +60,26 @@ export default [
|
|||
|
||||
// Best practices and style
|
||||
'no-console': ['warn', { allow: ['warn', 'error', 'info', 'debug'] }],
|
||||
'curly': ['error', 'all'],
|
||||
'eqeqeq': ['error', 'always', { null: 'ignore' }],
|
||||
curly: ['error', 'all'],
|
||||
eqeqeq: ['error', 'always', { null: 'ignore' }],
|
||||
'no-return-await': 'error',
|
||||
'require-await': 'error',
|
||||
'prettier/prettier': ['error', {
|
||||
'prettier/prettier': [
|
||||
'error',
|
||||
{
|
||||
singleQuote: true,
|
||||
trailingComma: 'es5',
|
||||
printWidth: 100,
|
||||
semi: false
|
||||
}]
|
||||
}
|
||||
semi: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.test.js', '**/*.spec.js'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
jest: true
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'node/no-unpublished-require': 'off',
|
||||
'node/no-missing-require': 'off'
|
||||
}
|
||||
}
|
||||
];
|
||||
'node/no-missing-require': 'off',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue