Skip to content

Commit a2d67fb

Browse files
committed
Linting
1 parent 7e57eb0 commit a2d67fb

6 files changed

+2149
-27
lines changed

.eslintignore

+7
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
node_modules/
2+
package-lock.json
3+
*.min.js
4+
*.jpeg
5+
*.jpg
6+
*.png
7+
8+
Horizon_TV_Fixer/**/*

.eslintrc.js

+103-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
module.exports = {
2+
root: true,
23
env: {
34
browser: true,
45
greasemonkey: true,
56
es2021: true,
67
},
8+
parserOptions: {
9+
ecmaVersion: "latest",
10+
},
11+
extends: [
12+
"plugin:@cspell/recommended",
13+
"plugin:security/recommended-legacy",
14+
15+
// Display Prettier errors as ESLint errors.
16+
// Enables eslint-plugin-prettier and eslint-config-prettier.
17+
"plugin:prettier/recommended",
18+
19+
//! Prettier should always be the last configuration in the extends array.
20+
],
21+
rules: {},
722
overrides: [
8-
{
9-
env: {
10-
node: true,
11-
},
12-
files: [".eslintrc.{js,cjs}"],
13-
parserOptions: {
14-
sourceType: "script",
15-
},
16-
},
23+
/*
24+
* Userscript files.
25+
*/
1726
{
1827
files: ["*.user.js"],
1928
extends: ["plugin:userscripts/recommended"],
20-
rules: {},
29+
rules: {
30+
"userscripts/better-use-match": "off", // Disable this warning for now.
31+
},
2132
settings: {
2233
userscriptVersions: {
2334
tampermonkey: ">=4",
@@ -26,9 +37,87 @@ module.exports = {
2637
},
2738
},
2839
},
40+
41+
/*
42+
* JSON files.
43+
*/
44+
{
45+
files: ["*.json"],
46+
extends: [
47+
"plugin:json/recommended-with-comments",
48+
49+
// Display Prettier errors as ESLint errors.
50+
// Enables eslint-plugin-prettier and eslint-config-prettier.
51+
"plugin:prettier/recommended",
52+
53+
//! Prettier should always be the last configuration in the extends array.
54+
],
55+
},
56+
57+
/*
58+
* `package.json` file.
59+
* This needs it's own configuration, because it doesn't work together with `plugin:json`.
60+
* See https://github.com/kellyselden/eslint-plugin-json-files/issues/40
61+
* Must be after `*.json`.
62+
*/
63+
{
64+
files: ["package.json"],
65+
plugins: ["json-files"],
66+
extends: [
67+
// Display Prettier errors as ESLint errors.
68+
// Enables eslint-plugin-prettier and eslint-config-prettier.
69+
"plugin:prettier/recommended",
70+
71+
//! Prettier should always be the last configuration in the extends array.
72+
],
73+
rules: {
74+
"json-files/ensure-repository-directory": "error",
75+
"json-files/no-branch-in-dependencies": "error",
76+
"json-files/require-engines": "error",
77+
"json-files/require-license": "error",
78+
"json-files/require-unique-dependency-names": "error",
79+
"json-files/sort-package-json": "error",
80+
},
81+
},
82+
83+
/*
84+
* Markdown files.
85+
*/
86+
{
87+
files: ["*.md"],
88+
parser: "eslint-plugin-markdownlint/parser",
89+
extends: [
90+
"plugin:markdownlint/recommended",
91+
92+
// Display Prettier errors as ESLint errors.
93+
// Enables eslint-plugin-prettier and eslint-config-prettier.
94+
"plugin:prettier/recommended",
95+
96+
//! Prettier should always be the last configuration in the extends array.
97+
],
98+
rules: {
99+
"markdownlint/md007": [
100+
"error",
101+
{
102+
indent: 4,
103+
},
104+
], // For compatibility with Prettier.
105+
"markdownlint/md030": [
106+
"error",
107+
{
108+
ol_multi: 3,
109+
ol_single: 3,
110+
ul_multi: 3,
111+
ul_single: 3,
112+
},
113+
], // For compatibility with Prettier.
114+
"markdownlint/md013": "off", // Disable line length.
115+
"markdownlint/md033": [
116+
"error",
117+
{ allowed_elements: ["br", "sup", "kbd"] },
118+
],
119+
"prettier/prettier": ["error", { parser: "markdown" }],
120+
},
121+
},
29122
],
30-
parserOptions: {
31-
ecmaVersion: "latest",
32-
},
33-
rules: {},
34123
};

.lockfile-lintrc.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"allowedHosts": ["npm"],
3+
"allowedPackageNameAliases": [
4+
"string-width-cjs:string-width",
5+
"strip-ansi-cjs:strip-ansi",
6+
"wrap-ansi-cjs:wrap-ansi"
7+
],
8+
"path": "package-lock.json",
9+
"type": "npm",
10+
"validateHttps": true,
11+
"validatePackageNames": true
12+
}

.prettierignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
package-lock.json
3+
*.min.js
4+
*.jpeg
5+
*.jpg
6+
*.png
7+
8+
Horizon_TV_Fixer/**/*

0 commit comments

Comments
 (0)