const js = require('@eslint/js'); const stylistic = require('@stylistic/eslint-plugin'); const globals = require('globals'); module.exports = [ js.configs.recommended, { plugins: { '@stylistic': stylistic }, languageOptions: { ecmaVersion: 2020, sourceType: 'commonjs', globals: { ...globals.node, ...globals.commonjs, ...globals.es2020, Atomics: 'readonly', SharedArrayBuffer: 'readonly' } }, rules: { // Stylistic rules (migrated from airbnb-base) '@stylistic/comma-dangle': ['error', 'never'], '@stylistic/indent': ['error', 2, { SwitchCase: 1 }], '@stylistic/semi': ['error', 'always'], '@stylistic/quotes': ['error', 'single', { avoidEscape: true }], '@stylistic/arrow-parens': ['error', 'always'], '@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }], '@stylistic/comma-spacing': ['error', { before: false, after: true }], '@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true }], '@stylistic/keyword-spacing': ['error', { before: true, after: true }], '@stylistic/eol-last': ['error', 'always'], '@stylistic/no-trailing-spaces': 'error', '@stylistic/space-before-blocks': 'error', '@stylistic/space-infix-ops': 'error', '@stylistic/arrow-spacing': ['error', { before: true, after: true }], // JS rules (migrated from airbnb-base) 'no-console': 'off', 'no-var': 'error', 'prefer-const': 'error', 'prefer-arrow-callback': 'error', 'prefer-template': 'error', 'object-shorthand': ['error', 'always'], 'no-shadow': 'error', 'no-use-before-define': ['error', { functions: true, classes: true, variables: true }], 'camelcase': ['error', { properties: 'never' }], 'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }] } } ];