Skip to content

refactor: Add ESLint #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ on:
branches:
- '**'
jobs:
lint:
name: Lint
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
test:
strategy:
matrix:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ node_modules

# Mac DS_Store files
.DS_Store

# Optional eslint cache
.eslintcache
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.0
20.15.0
4 changes: 2 additions & 2 deletions .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function config() {
// Get branch
const branch = ref.split('/').pop();
console.log(`Running on branch: ${branch}`);

// Set changelog file
//const changelogFile = `./changelogs/CHANGELOG_${branch}.md`;
const changelogFile = `./CHANGELOG.md`;
Expand Down Expand Up @@ -107,7 +107,7 @@ async function loadTemplates() {

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

Expand Down
38 changes: 38 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from "@eslint/js";

export default [
js.configs.recommended,
{
languageOptions: {
globals: {
__dirname: true,
beforeEach: true,
Buffer: true,
console: true,
describe: true,
fail: true,
expect: true,
global: true,
it: true,
jasmine: true,
process: true,
spyOn: true,
},
},
rules: {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"no-trailing-spaces": 2,
"eol-last": 2,
"space-in-parens": ["error", "never"],
"no-multiple-empty-lines": 1,
"prefer-const": "error",
"space-infix-ops": "error",
"no-useless-escape": "off",
"no-var": "error",
"no-unused-vars": "warn",
"no-undef": "warn",
"no-prototype-builtins": "off",
}
}
];
Loading