-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
35 lines (32 loc) · 1.28 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import globals from 'globals';
import js from '@eslint/js';
import stylisticJs from '@stylistic/eslint-plugin-js';
export default [
js.configs.recommended,
{ ignores: ['**/node_modules/*', '**/.git/*', '**/www/js/lib/*', '**/plugins/*', '**/platforms/*'] },
{
files: ['**/*.{js,mjs}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.node
}
},
plugins: {
'@stylistic/js': stylisticJs
},
rules: {
'@stylistic/js/indent': ['error', 2, { 'SwitchCase': 1 }], // Tab indentation (size of 2 spaces)
'@stylistic/js/quotes': ['error', 'single', { 'allowTemplateLiterals': true }], // `'` instead of `"`
'curly': 'error', // Curly braces for block statements
'@stylistic/js/brace-style': 'error', // 1TBS brace style
'@stylistic/js/semi': ['error', 'always'], // Semicolon at the end of each statement
'object-shorthand': ['error', 'always'], // Object shorthand for ES6
'@stylistic/js/arrow-parens': ['error', 'always'], // Parenthesis around arrow function argument
// Minimum line breaks
'@stylistic/js/keyword-spacing': 'error',
'@stylistic/js/no-multiple-empty-lines': 'error',
'strict': ['error', 'never'] // No `use strict`
}
}