-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #310 from KristjanESPERANTO/linter
Add JavaScript linting and GitHub workflow for testing
- Loading branch information
Showing
8 changed files
with
4,220 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Automated Tests | ||
on: | ||
push: | ||
branches: [master, develop] | ||
pull_request: | ||
branches: [master, develop] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
run-lint: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- run: echo "Starting automated tests for ${{ github.repository }} on ${{ github.ref }}" | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: npm | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Check spelling | ||
run: npm run test:spelling | ||
- name: Check linting | ||
run: npm run lint | ||
- run: echo "Test job status is ${{ job.status }}." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,4 @@ node_modules | |
# Default settings | ||
settings.json | ||
|
||
# Package Lock File | ||
package-lock.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import eslintPluginImport from "eslint-plugin-import"; | ||
import eslintPluginJs from "@eslint/js"; | ||
import globals from "globals"; | ||
|
||
const config = [ | ||
eslintPluginImport.flatConfigs.recommended, | ||
eslintPluginJs.configs.recommended, | ||
{ | ||
"ignores": ["**/*.min.js"] | ||
}, | ||
{ | ||
"files": ["**/*.js"], | ||
"languageOptions": { | ||
"globals": { | ||
...globals.browser, | ||
...globals.node | ||
}, | ||
"sourceType": "commonjs" | ||
}, | ||
"rules": { | ||
"capitalized-comments": "off", | ||
"consistent-this": "off", | ||
"line-comment-position": "off", | ||
"max-lines-per-function": ["warn", 200], | ||
"max-statements": ["warn", 60], | ||
"multiline-comment-style": "off", | ||
"no-await-in-loop": "off", | ||
"no-constant-binary-expression": "warn", | ||
"no-inline-comments": "off", | ||
"no-magic-numbers": "off", | ||
"no-plusplus": "off", | ||
"no-prototype-builtins": "warn", | ||
"no-undef": "warn", | ||
"no-unused-vars": "warn", | ||
"no-useless-escape": "warn", | ||
"no-var": "warn", | ||
"one-var": "off", | ||
"sort-keys": "off", | ||
"strict": "off" | ||
} | ||
}, | ||
{ | ||
"files": ["**/*.mjs"], | ||
"languageOptions": { | ||
"ecmaVersion": "latest", | ||
"globals": { | ||
...globals.node | ||
}, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"func-style": "off", | ||
"max-lines-per-function": ["error", 100], | ||
"no-magic-numbers": "off", | ||
"one-var": "off", | ||
"prefer-destructuring": "off" | ||
} | ||
} | ||
]; | ||
|
||
export default config; |
Oops, something went wrong.