Skip to content

Commit bd679b4

Browse files
authored
Merge pull request #95 from wagoid/style/add-eslint-config
style: add eslint to the project
2 parents 300f6dc + 574a671 commit bd679b4

File tree

12 files changed

+2448
-105
lines changed

12 files changed

+2448
-105
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ coverage
77
fixtures
88
src/action.test.js
99
src/testUtils.js
10+
.eslintrc.json

.eslintrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": ["airbnb-base", "prettier", "plugin:node/recommended"],
3+
"plugins": ["prettier"],
4+
"rules": {
5+
"prettier/prettier": "error",
6+
"no-console": "off",
7+
"no-process-exit": "off",
8+
"node/no-unpublished-require": "off"
9+
}
10+
}

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: CI
22
on: [push]
33

44
jobs:
5-
test:
6-
name: Test
5+
sanity-checks:
6+
name: Sanity Checks
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
@@ -19,9 +19,10 @@ jobs:
1919
restore-keys: |
2020
${{ runner.os }}-node-
2121
- run: npm install
22+
- run: npm run lint
2223
- run: npm test -- --ci --coverage
2324
release:
24-
needs: test
25+
needs: sanity-checks
2526
runs-on: ubuntu-latest
2627
if: "github.ref == 'refs/heads/master' && !contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
2728
env:

.lintstagedrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
22
'*.{ts,tsx,vue,css,less,scss,html,htm,md,markdown}': 'prettier --write',
3-
'*.{js,jsx,json,yml,yaml}': ['prettier --write', () => 'npm run test'],
3+
'*.{json,yml,yaml}': ['prettier --write', () => 'npm run test'],
4+
'*.{js,jsx}': ['eslint --fix', () => 'npm run test']],
45
}

commitlint.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
12
const { maxLineLength } = require('@commitlint/ensure')
23

34
const bodyMaxLineLength = 100
45

5-
const validateBodyMaxLengthIgnoringDeps = parsedCommit => {
6+
const validateBodyMaxLengthIgnoringDeps = (parsedCommit) => {
67
const { type, scope, body } = parsedCommit
78
const isDepsCommit =
89
type === 'chore' && (scope === 'deps' || scope === 'deps-dev')

0 commit comments

Comments
 (0)