Skip to content

Commit 51913c3

Browse files
committed
style: add eslint to the project
The config is based on airbnb shared config, with some rules that work better with the project.
1 parent 300f6dc commit 51913c3

11 files changed

+2444
-102
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+
}

.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)