2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00
Files
axios/eslint.config.js
T
Jay 3e6b4e1f31 fix: error unexpected token in fetch JS compatibility issue with Webpack 4 (#10864)
* chore: added npm run lint step between install and build in build-and-run-vitest

* chore: acorn ^8.16.0 added as a devDependency

* test: added test to parse all lib files via acorn

* feat: added globalThis: "readonly"

* feat: ?? replaced with the verbose ternary
2026-05-07 19:36:11 +02:00

60 lines
1.2 KiB
JavaScript

import js from '@eslint/js';
import globals from 'globals';
export default [
{
...js.configs.recommended,
files: ['lib/**/*.js'],
linterOptions: {
reportUnusedDisableDirectives: 'off'
},
languageOptions: {
ecmaVersion: 2018,
sourceType: 'module'
},
rules: {
...js.configs.recommended.rules,
'no-cond-assign': 0,
'no-useless-assignment': 'off',
'no-unused-vars': [
'error',
{ args: 'none', caughtErrors: 'none', varsIgnorePattern: '^_' }
]
}
},
{
files: ['lib/**/*.js'],
ignores: [
'lib/adapters/http.js',
'lib/adapters/xhr.js',
'lib/platform/node/**/*.js',
'lib/platform/browser/**/*.js'
],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
globalThis: 'readonly'
}
}
},
{
files: ['lib/adapters/http.js', 'lib/platform/node/**/*.js'],
languageOptions: {
globals: {
...globals.node,
globalThis: 'readonly'
}
}
},
{
files: ['lib/adapters/xhr.js', 'lib/platform/browser/**/*.js'],
languageOptions: {
globals: {
...globals.browser,
globalThis: 'readonly'
}
}
}
];