Add eslint as linter and add linter workflow
This commit is contained in:
parent
85821f5fa3
commit
bab508e4b9
4 changed files with 1191 additions and 5 deletions
22
.github/workflows/lint.yml
vendored
Normal file
22
.github/workflows/lint.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
name: Lint Codebase
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
eslint:
|
||||||
|
runs-on: node
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 'latest'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Run ESLint
|
||||||
|
run: npm run lint
|
32
eslint.config.mjs
Normal file
32
eslint.config.mjs
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
import jest from "eslint-plugin-jest";
|
||||||
|
import globals from "globals";
|
||||||
|
export default [{
|
||||||
|
plugins: {
|
||||||
|
jest,
|
||||||
|
},
|
||||||
|
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.jest,
|
||||||
|
...jest.environments.globals.globals,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
"no-fallthrough": "error",
|
||||||
|
"no-case-declarations": "error",
|
||||||
|
"no-unused-vars": "warn"
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// /** @type {import('eslint').Linter.Config[]} */
|
||||||
|
// export default [
|
||||||
|
// {files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}},
|
||||||
|
// {languageOptions: { globals: globals.node }},
|
||||||
|
// pluginJs.configs.recommended,
|
||||||
|
// ];
|
1135
package-lock.json
generated
1135
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -11,7 +11,8 @@
|
||||||
"sqlite3": "^5.1.6"
|
"sqlite3": "^5.1.6"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest"
|
"test": "jest",
|
||||||
|
"lint": "npx eslint ."
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -20,7 +21,11 @@
|
||||||
"author": "SileNce5k",
|
"author": "SileNce5k",
|
||||||
"license": "UNLICENSE",
|
"license": "UNLICENSE",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.14.0",
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
|
"eslint": "^9.14.0",
|
||||||
|
"eslint-plugin-jest": "^28.8.3",
|
||||||
|
"globals": "^15.12.0",
|
||||||
"jest": "^29.7.0"
|
"jest": "^29.7.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue