Skip to content

Commit 9e13e9a

Browse files
authored
refactor: Add ESLint (#259)
1 parent be1ddb9 commit 9e13e9a

21 files changed

+1694
-666
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ on:
77
branches:
88
- '**'
99
jobs:
10+
lint:
11+
name: Lint
12+
timeout-minutes: 15
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Use Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
cache: npm
20+
- name: Install dependencies
21+
run: npm ci
22+
- name: Lint
23+
run: npm run lint
1024
test:
1125
strategy:
1226
matrix:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ node_modules
3737

3838
# Mac DS_Store files
3939
.DS_Store
40+
41+
# Optional eslint cache
42+
.eslintcache

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.16.0
1+
20.15.0

.releaserc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function config() {
2727
// Get branch
2828
const branch = ref.split('/').pop();
2929
console.log(`Running on branch: ${branch}`);
30-
30+
3131
// Set changelog file
3232
//const changelogFile = `./changelogs/CHANGELOG_${branch}.md`;
3333
const changelogFile = `./CHANGELOG.md`;
@@ -107,7 +107,7 @@ async function loadTemplates() {
107107

108108
function getReleaseComment() {
109109
const url = repositoryUrl + '/releases/tag/${nextRelease.gitTag}';
110-
let comment = '🎉 This change has been released in version [${nextRelease.version}](' + url + ')';
110+
const comment = '🎉 This change has been released in version [${nextRelease.version}](' + url + ')';
111111
return comment;
112112
}
113113

eslint.config.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import js from "@eslint/js";
2+
3+
export default [
4+
js.configs.recommended,
5+
{
6+
languageOptions: {
7+
globals: {
8+
__dirname: true,
9+
beforeEach: true,
10+
Buffer: true,
11+
console: true,
12+
describe: true,
13+
fail: true,
14+
expect: true,
15+
global: true,
16+
it: true,
17+
jasmine: true,
18+
process: true,
19+
spyOn: true,
20+
},
21+
},
22+
rules: {
23+
"indent": ["error", 2],
24+
"linebreak-style": ["error", "unix"],
25+
"no-trailing-spaces": 2,
26+
"eol-last": 2,
27+
"space-in-parens": ["error", "never"],
28+
"no-multiple-empty-lines": 1,
29+
"prefer-const": "error",
30+
"space-infix-ops": "error",
31+
"no-useless-escape": "off",
32+
"no-var": "error",
33+
"no-unused-vars": "warn",
34+
"no-undef": "warn",
35+
"no-prototype-builtins": "off",
36+
}
37+
}
38+
];

0 commit comments

Comments
 (0)