Skip to content

Commit e2a4cc6

Browse files
committed
Add linting, spellcheck, and editor configs
Add project tooling and editor configs: new cspell config and GitHub spellcheck workflow, .prettierignore, .nvmrc and VSCode recommendations/settings. Tighten linters and CI: expand .eslintrc rules, update super-linter/codeql YAML headers, enable an HTMLHint rule change. Update package.json: add htmlhint and cspell scripts, bump prettier, and record Volta node version. Apply small code hygiene changes to source and minified JS ("use strict" and clearer if/else), and normalize README badge text. Update CI, prettierignore, and README wording Minor repository tweaks: use consistent double quotes in the spellcheck workflow name, disable VALIDATE_NATURAL_LANGUAGE in the super-linter workflow, add .cspell.json to .prettierignore to avoid formatting the spellcheck config, and change README text to refer to the localStorage API. Update CI, prettierignore, and README wording Minor repository tweaks: use consistent double quotes in the spellcheck workflow name, disable VALIDATE_NATURAL_LANGUAGE in the super-linter workflow, add .cspell.json to .prettierignore to avoid formatting the spellcheck config, and change README text to refer to the localStorage API. Add package.json to .prettierignore; tidy extensions Add package.json to .prettierignore so Prettier ignores it. Also normalize .vscode/extensions.json by compacting the recommendations array to a single line and adjust newline/EOF formatting in .prettierignore. Add package.json to .prettierignore; tidy extensions Add package.json to .prettierignore so Prettier ignores it. Also normalize .vscode/extensions.json by compacting the recommendations array to a single line and adjust newline/EOF formatting in .prettierignore. Remove .eslintignore and update ESLint config Delete the standalone .eslintignore and consolidate ignores into .eslintrc.json (added "node_modules/" to ignorePatterns). Also adjust parserOptions.ecmaVersion from 2020 to 2015 to target ES2015 syntax; no other rule changes.
1 parent b354079 commit e2a4cc6

15 files changed

Lines changed: 119 additions & 14 deletions

.cspell.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "0.2",
3+
"words": [
4+
"christianoliff",
5+
"fediverse",
6+
"fnames",
7+
"Oliff",
8+
"stylelint",
9+
"tagname",
10+
"unspaced"
11+
],
12+
"allowCompoundWords": true,
13+
"language": "en,en-US",
14+
"ignorePaths": [
15+
".cspell.json",
16+
"**/node_modules/**"
17+
],
18+
"useGitignore": true
19+
}

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.json

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"root": true,
33
"extends": ["eslint:recommended", "prettier"],
4+
"ignorePatterns": ["dark-mode-switch.min.js", "node_modules/"],
45
"env": {
56
"browser": true,
67
"es6": true
@@ -10,12 +11,40 @@
1011
"sourceType": "script"
1112
},
1213
"rules": {
14+
"strict": ["error", "global"],
15+
"curly": ["error", "all"],
16+
"eqeqeq": ["error", "always"],
17+
"no-alert": "error",
18+
"no-caller": "error",
19+
"no-console": "error",
20+
"no-else-return": "error",
21+
"no-eval": "error",
22+
"no-extend-native": "error",
23+
"no-extra-bind": "error",
24+
"no-implicit-coercion": "error",
25+
"no-implied-eval": "error",
26+
"no-iterator": "error",
27+
"no-labels": "error",
28+
"no-lone-blocks": "error",
29+
"no-multi-str": "error",
30+
"no-new-func": "error",
31+
"no-new-wrappers": "error",
32+
"no-octal-escape": "error",
33+
"no-proto": "error",
34+
"no-return-assign": "error",
35+
"no-script-url": "error",
36+
"no-self-compare": "error",
37+
"no-sequences": "error",
38+
"no-throw-literal": "error",
1339
"no-undef": "error",
40+
"no-unused-expressions": "error",
1441
"no-unused-vars": "error",
15-
"no-console": "warn",
16-
"eqeqeq": ["error", "always"],
17-
"curly": ["error", "all"],
42+
"no-useless-call": "error",
43+
"no-useless-concat": "error",
1844
"no-var": "off",
19-
"prefer-const": "off"
45+
"prefer-const": "off",
46+
"radix": "error",
47+
"wrap-iife": ["error", "outside"],
48+
"yoda": "error"
2049
}
2150
}

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: "CodeQL"
23

34
on:

.github/workflows/spellcheck.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: "Check spelling"
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: spellcheck-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
spellcheck:
18+
runs-on: ubuntu-latest
19+
if: ${{ github.actor != 'dependabot[bot]' }}
20+
steps:
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
24+
25+
- uses: streetsidesoftware/cspell-action@9cd41bb518a24fefdafd9880cbab8f0ceba04d28 # v8.3.0
26+
with:
27+
check_dot_files: false
28+
incremental_files_only: true
29+
inline: warning
30+
suggestions: true

.github/workflows/super-linter.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Lint Code Base
23

34
on:
@@ -39,3 +40,4 @@ jobs:
3940
VALIDATE_HTML_PRETTIER: false
4041
VALIDATE_JSCPD: false
4142
VALIDATE_MARKDOWN: false
43+
VALIDATE_NATURAL_LANGUAGE: false

.htmlhintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"id-unique": false,
2020
"inline-script-disabled": false,
2121
"inline-style-disabled": false,
22+
"link-rel-canonical-require": true,
2223
"main-require": true,
2324
"meta-charset-require": true,
2425
"meta-description-require": true,

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.22.2

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.min.*
2+
.cspell.json
3+
package.json

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["EditorConfig.EditorConfig"]
3+
}

0 commit comments

Comments
 (0)