mirror of
https://github.com/netbymatt/nexrad-level-2-plot.git
synced 2026-11-28 10:28:04 -08:00
eslint update
This commit is contained in:
4 files changed
+3693
-1112
No files matched your search
@@ -1,78 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
commonjs: true,
|
||||
node: true,
|
||||
jquery: true,
|
||||
},
|
||||
extends: 'airbnb-base',
|
||||
globals: {
|
||||
Atomics: 'readonly',
|
||||
SharedArrayBuffer: 'readonly',
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
},
|
||||
rules: {
|
||||
indent: [
|
||||
'error',
|
||||
'tab',
|
||||
],
|
||||
'no-use-before-define': [
|
||||
'error',
|
||||
{
|
||||
variables: false,
|
||||
},
|
||||
],
|
||||
'no-param-reassign': [
|
||||
'error',
|
||||
{
|
||||
props: false,
|
||||
},
|
||||
],
|
||||
'no-tabs': 0,
|
||||
'no-console': 0,
|
||||
'max-len': 0,
|
||||
'linebreak-style': 0,
|
||||
quotes: [
|
||||
'error',
|
||||
'single',
|
||||
],
|
||||
semi: [
|
||||
'error',
|
||||
'always',
|
||||
],
|
||||
'no-prototype-builtins': 0,
|
||||
'comma-dangle': ['error', 'always-multiline'],
|
||||
'block-scoped-var': ['error'],
|
||||
'default-case': ['error'],
|
||||
'default-param-last': ['error'],
|
||||
'dot-location': ['error', 'property'],
|
||||
eqeqeq: ['error'],
|
||||
'no-eval': ['error'],
|
||||
'no-eq-null': ['error'],
|
||||
'no-floating-decimal': ['error'],
|
||||
'no-trailing-spaces': ['error'],
|
||||
'brace-style': [2, '1tbs', { allowSingleLine: true }],
|
||||
'no-mixed-operators': [
|
||||
'error',
|
||||
{
|
||||
groups: [
|
||||
['&', '|', '^', '~', '<<', '>>', '>>>'],
|
||||
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
||||
['&&', '||'],
|
||||
['in', 'instanceof'],
|
||||
],
|
||||
allowSamePrecedence: true,
|
||||
},
|
||||
],
|
||||
'no-underscore-dangle': ['error', {
|
||||
allowAfterThis: true,
|
||||
}],
|
||||
'no-bitwise': 0,
|
||||
},
|
||||
ignorePatterns: [
|
||||
'*.min.js',
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,85 @@
|
||||
import path from 'node:path';
|
||||
|
||||
import { includeIgnoreFile } from '@eslint/compat';
|
||||
import js from '@eslint/js';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
import { configs, plugins } from 'eslint-config-airbnb-extended';
|
||||
|
||||
const gitignorePath = path.resolve('.', '.gitignore');
|
||||
|
||||
const jsConfig = defineConfig([
|
||||
// ESLint recommended config
|
||||
{
|
||||
name: 'js/config',
|
||||
...js.configs.recommended,
|
||||
},
|
||||
// Stylistic plugin
|
||||
plugins.stylistic,
|
||||
// Import X plugin
|
||||
plugins.importX,
|
||||
// Airbnb base recommended config
|
||||
...configs.base.recommended,
|
||||
]);
|
||||
|
||||
const nodeConfig = defineConfig([
|
||||
// Node plugin
|
||||
plugins.node,
|
||||
// Airbnb Node recommended config
|
||||
...configs.node.recommended,
|
||||
]);
|
||||
|
||||
const rules = {
|
||||
'@stylistic/indent': ['error', 'tab', { SwitchCase: 1 }],
|
||||
'@stylistic/no-tabs': 0,
|
||||
'no-param-reassign': [
|
||||
'error',
|
||||
{
|
||||
props: false,
|
||||
},
|
||||
],
|
||||
'@stylistic/max-len': 0,
|
||||
'no-underscore-dangle': [
|
||||
'error',
|
||||
{
|
||||
allowAfterThis: true,
|
||||
},
|
||||
],
|
||||
'import-x/no-useless-path-segments': 0,
|
||||
'no-bitwise': 0,
|
||||
'import-x/extensions': [
|
||||
'error',
|
||||
'ignorePackages',
|
||||
{
|
||||
js: 'always',
|
||||
mjs: 'always',
|
||||
json: 'always',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const languageOptions = {
|
||||
ecmaVersion: 'latest',
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
},
|
||||
};
|
||||
|
||||
const ignores = [
|
||||
'docs/**',
|
||||
];
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
ignores,
|
||||
},
|
||||
// Ignore files and folders listed in .gitignore
|
||||
includeIgnoreFile(gitignorePath),
|
||||
// JavaScript config
|
||||
...jsConfig,
|
||||
// Node config
|
||||
...nodeConfig,
|
||||
{
|
||||
languageOptions,
|
||||
rules,
|
||||
},
|
||||
]);
|
||||
Generated
+3600
-1028
File diff suppressed because it is too large.
Load diff
+8
-6
@@ -4,7 +4,8 @@
|
||||
"description": "Plotting library for nexrad-level-2-data",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"lint": "npx eslint .",
|
||||
"lint:fix": "npx eslint . --fix"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -28,12 +29,13 @@
|
||||
"nexrad-level-2-data": "file:../nexrad-level-2-data"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-import": "^2.23.4",
|
||||
"glob": "^10.0.0"
|
||||
"@eslint/compat": "^2.1.0",
|
||||
"@eslint/js": "^9.39.5",
|
||||
"eslint": "^9.39.5",
|
||||
"eslint-config-airbnb-extended": "^3.1.1",
|
||||
"glob": "^13.0.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=13.0.0"
|
||||
"node": ">=24.0.0"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user