update eslint via compatability layer with airbnb-base

This commit is contained in:
Matt Walsh
2025-06-14 11:35:33 -05:00
parent a11e783cde
commit 57395b8dc7
7 changed files with 550 additions and 1067 deletions

View File

@@ -1,2 +0,0 @@
*.min.*
server/scripts/vendor/*

View File

@@ -1,92 +0,0 @@
{
"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"
]
}

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
legacy-peer-deps=true

105
eslint.config.mjs Normal file
View 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',
],
}),
];

1408
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,9 +24,10 @@
"devDependencies": {
"@aws-sdk/client-cloudfront": "^3.609.0",
"del": "^8.0.0",
"eslint": "^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint": "^9.0.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "^2.10.0",
"@eslint/eslintrc": "^3.3.1",
"gulp": "^5.0.0",
"gulp-awspublish": "^8.0.0",
"gulp-concat": "^2.6.1",
@@ -50,4 +51,4 @@
"ejs": "^3.1.5",
"express": "^5.1.0"
}
}
}

View File

@@ -139,7 +139,7 @@ const getStations = async (stations) => {
StationId: station.id,
city: station.city,
};
} catch (error) {
} catch {
console.log(`Unable to get latest observations for ${station.id}`);
return false;
}