mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 15:49:31 -07:00
update eslint via compatability layer with airbnb-base
This commit is contained in:
105
eslint.config.mjs
Normal file
105
eslint.config.mjs
Normal file
@@ -0,0 +1,105 @@
|
||||
import { FlatCompat } from '@eslint/eslintrc';
|
||||
|
||||
const compat = new FlatCompat({
|
||||
});
|
||||
|
||||
export default [{
|
||||
ignores: [
|
||||
'*.min.*',
|
||||
'server/scripts/vendor/*',
|
||||
'dist/**/*',
|
||||
],
|
||||
},
|
||||
...compat.config({
|
||||
env: {
|
||||
browser: true,
|
||||
es6: true,
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
'airbnb-base',
|
||||
],
|
||||
globals: {
|
||||
TravelCities: 'readonly',
|
||||
RegionalCities: 'readonly',
|
||||
StationInfo: 'readonly',
|
||||
SunCalc: 'readonly',
|
||||
NoSleep: 'readonly',
|
||||
OVERRIDES: 'readonly',
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: [],
|
||||
rules: {
|
||||
indent: [
|
||||
'error',
|
||||
'tab',
|
||||
{
|
||||
SwitchCase: 1,
|
||||
},
|
||||
],
|
||||
'no-tabs': 0,
|
||||
'no-console': 0,
|
||||
'max-len': 0,
|
||||
'no-use-before-define': [
|
||||
'error',
|
||||
{
|
||||
variables: false,
|
||||
},
|
||||
],
|
||||
'no-param-reassign': [
|
||||
'error',
|
||||
{
|
||||
props: false,
|
||||
},
|
||||
],
|
||||
'no-mixed-operators': [
|
||||
'error',
|
||||
{
|
||||
groups: [
|
||||
[
|
||||
'&',
|
||||
'|',
|
||||
'^',
|
||||
'~',
|
||||
'<<',
|
||||
'>>',
|
||||
'>>>',
|
||||
],
|
||||
[
|
||||
'==',
|
||||
'!=',
|
||||
'===',
|
||||
'!==',
|
||||
'>',
|
||||
'>=',
|
||||
'<',
|
||||
'<=',
|
||||
],
|
||||
[
|
||||
'&&',
|
||||
'||',
|
||||
],
|
||||
[
|
||||
'in',
|
||||
'instanceof',
|
||||
],
|
||||
],
|
||||
allowSamePrecedence: true,
|
||||
},
|
||||
],
|
||||
'import/extensions': [
|
||||
'error',
|
||||
{
|
||||
mjs: 'always',
|
||||
json: 'always',
|
||||
},
|
||||
],
|
||||
},
|
||||
ignorePatterns: [
|
||||
'*.min.js',
|
||||
],
|
||||
}),
|
||||
];
|
||||
Reference in New Issue
Block a user