Skip to content

Commit

Permalink
refactor: Add ESLint (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
dplewis authored Jul 7, 2024
1 parent be1ddb9 commit 9e13e9a
Show file tree
Hide file tree
Showing 21 changed files with 1,694 additions and 666 deletions.
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

0 comments on commit 9e13e9a

Please sign in to comment.