Add eslint

This commit is contained in:
Jake Howard 2022-08-03 20:55:09 +01:00
parent 512f9cd3b9
commit eae2953b89
Signed by: jake
GPG key ID: 57AFB45680EDD477
7 changed files with 1972 additions and 5 deletions

1
.eslintignore Symbolic link
View file

@ -0,0 +1 @@
./.gitignore

12
.eslintrc Normal file
View file

@ -0,0 +1,12 @@
{
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 6
},
"env": {
"browser": true,
"node": true
}
}

View file

@ -113,7 +113,7 @@ djhtml:
script:
- git ls-files '*.html' | xargs djhtml --check --tabwidth 2
prettier:
npm_lint:
<<: *node_test_template
script:
- npm run lint

1949
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -9,12 +9,17 @@
"build:css": "sass --style=compressed --load-path=$PWD/node_modules static/src/scss:static/build/css",
"build:contrib": "./scripts/copy-npm-contrib.sh",
"build": "npm-run-all build:*",
"lint": "prettier --check static/src",
"format": "prettier --write static/src"
"lint:eslint": "eslint --ext js --report-unused-disable-directives .",
"lint:prettier": "prettier --check static/src",
"lint": "npm-run-all lint:*",
"format:prettier": "prettier --write static/src",
"format:eslint": "npm run lint:eslint -- --fix",
"format": "npm-run-all format:*"
},
"author": "Jake Howard",
"devDependencies": {
"esbuild": "^0.14.43",
"eslint": "^8.21.0",
"npm-run-all": "^4.1.5",
"prettier": "2.6.2",
"sass": "^1.52.3"

View file

@ -71,7 +71,7 @@ window.addEventListener("DOMContentLoaded", () => {
let scrollTarget = null;
try {
scrollTarget = document.getElementById(window.location.hash.slice(1));
} catch {
} catch (e) {
// Probably an invalid selector - just ignore it
}

View file

@ -1,4 +1,4 @@
import * as DarkReader from "darkreader";
const DarkReader = require("darkreader");
const DARK_READER_OPTIONS = {};