2024-12-06 00:32:27 -08:00
|
|
|
import eslintPluginJs from '@eslint/js';
|
|
|
|
import eslintPluginStylistic from '@stylistic/eslint-plugin';
|
|
|
|
import globals from 'globals';
|
|
|
|
|
|
|
|
const config = [
|
|
|
|
{
|
|
|
|
files: ['**/*.js', '**/*.mjs'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
languageOptions: {
|
|
|
|
globals: {
|
|
|
|
...globals.browser,
|
|
|
|
...globals.node,
|
|
|
|
Log: 'readonly',
|
|
|
|
MM: 'readonly',
|
|
|
|
Module: 'readonly',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: {
|
|
|
|
...eslintPluginStylistic.configs['all-flat'].plugins,
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
...eslintPluginJs.configs.recommended.rules,
|
|
|
|
...eslintPluginStylistic.configs['all-flat'].rules,
|
|
|
|
'@stylistic/array-element-newline': 'off',
|
|
|
|
'@stylistic/brace-style': ['error', '1tbs', {allowSingleLine: true}],
|
|
|
|
'@stylistic/comma-dangle': ['error', 'only-multiline'],
|
|
|
|
'@stylistic/dot-location': ['error', 'property'],
|
|
|
|
'@stylistic/function-call-argument-newline': 'off',
|
|
|
|
'@stylistic/indent': ['error', 2],
|
|
|
|
'@stylistic/padded-blocks': 'off',
|
|
|
|
'@stylistic/quote-props': ['error', 'consistent-as-needed'],
|
|
|
|
'@stylistic/quotes': ['error', 'single'],
|
|
|
|
'@stylistic/multiline-comment-style': 'off',
|
|
|
|
'@stylistic/multiline-ternary': 'off',
|
2024-12-08 15:44:21 -08:00
|
|
|
'@stylistic/no-extra-parens': 'off',
|
2024-12-06 00:38:56 -08:00
|
|
|
'object-shorthand': ['error', 'always']
|
2024-12-06 00:32:27 -08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
export default config;
|