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