testenv: restored eslint

This commit is contained in:
Maxim Devaev 2024-08-27 01:48:52 +03:00
parent 0c213add4a
commit 308911191a
3 changed files with 59 additions and 39 deletions

View File

@ -0,0 +1,57 @@
const js = require("/usr/lib/node_modules/eslint/node_modules/@eslint/js/src/index.js");
const globals = require("/usr/lib/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/index.js");
const parser = require("/usr/lib/node_modules/@babel/eslint-parser/lib/index.cjs");
module.exports = [
js.configs.recommended,
{
files: ["**/*.js"],
languageOptions: {
globals: globals.browser,
ecmaVersion: 2015,
parser: parser,
parserOptions: {
ecmaVersion: 2025,
sourceType: "module",
allowImportExportEverywhere: true,
requireConfigFile: false,
},
},
},
{
rules: {
indent: [
"error",
"tab",
{SwitchCase: 1},
],
"linebreak-style": [
"error",
"unix",
],
quotes: [
"error",
"double",
],
"quote-props": [
"error",
"always",
],
"semi": [
"error",
"always",
],
"comma-dangle": [
"error",
"always-multiline",
],
"no-unused-vars": [
"error",
{vars: "local", args: "after-used"},
],
},
},
];

View File

@ -1,36 +0,0 @@
env:
browser: true
es6: true
extends: "eslint:recommended"
parser: "/usr/lib/node_modules/@babel/eslint-parser"
parserOptions:
ecmaVersion: 6
sourceType: module
allowImportExportEverywhere: true
requireConfigFile: false
rules:
indent:
- error
- tab
- SwitchCase: 1
linebreak-style:
- error
- unix
quotes:
- error
- double
quote-props:
- error
- always
semi:
- error
- always
comma-dangle:
- error
- always-multiline
no-unused-vars:
- error
- {vars: local, args: after-used}

View File

@ -1,6 +1,5 @@
[tox] [tox]
envlist = flake8, pylint, mypy, vulture, pytest, htmlhint, shellcheck envlist = flake8, pylint, mypy, vulture, pytest, eslint, htmlhint, shellcheck
#envlist = flake8, pylint, mypy, vulture, pytest, eslint, htmlhint, shellcheck
skipsdist = true skipsdist = true
[testenv] [testenv]
@ -55,7 +54,7 @@ deps =
[testenv:eslint] [testenv:eslint]
allowlist_externals = eslint allowlist_externals = eslint
commands = eslint --cache-location=/tmp --config=testenv/linters/eslintrc.yaml --color --ext .js web/share/js commands = eslint --cache-location=/tmp --config=testenv/linters/eslintrc.js --color web/share/js
[testenv:htmlhint] [testenv:htmlhint]
allowlist_externals = htmlhint allowlist_externals = htmlhint