32 lines
852 B
JavaScript
32 lines
852 B
JavaScript
import globals from 'globals';
|
|
import pluginJs from '@eslint/js';
|
|
import pluginReact from 'eslint-plugin-react';
|
|
|
|
export default [
|
|
{
|
|
files: ['**/*.{js,mjs,cjs,jsx}'],
|
|
rules: {
|
|
semi: 0,
|
|
'no-unused-vars': 1,
|
|
'comma-dangle': [1, {
|
|
arrays: 'only-multiline',
|
|
objects: 'only-multiline',
|
|
imports: 'only-multiline',
|
|
exports: 'only-multiline',
|
|
functions: 'only-multiline',
|
|
}],
|
|
yoda: ['error', 'always'],
|
|
'operator-linebreak': ['error', 'before'],
|
|
indent: ['error', 2, { SwitchCase: 1 }],
|
|
'space-before-function-paren': ['error', {
|
|
anonymous: 'never',
|
|
named: 'never',
|
|
asyncArrow: 'always',
|
|
}],
|
|
},
|
|
},
|
|
{ languageOptions: { globals: globals.browser } },
|
|
pluginJs.configs.recommended,
|
|
pluginReact.configs.flat.recommended,
|
|
];
|