Skip to content

Commit 6b02da4

Browse files
committed
style: add eslint & prettier
1 parent a1c9479 commit 6b02da4

File tree

7 files changed

+1328
-357
lines changed

7 files changed

+1328
-357
lines changed

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
ecmaVersion: 'latest',
5+
},
6+
env: {
7+
node: true,
8+
es6: true,
9+
},
10+
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
11+
ignorePatterns: ['coverage', '.eslintrc.js'],
12+
overrides: [
13+
{
14+
files: ['**/*.test.js'],
15+
plugins: ['jest'],
16+
extends: ['plugin:jest/recommended', 'plugin:jest/style'],
17+
env: {
18+
jest: true,
19+
},
20+
},
21+
],
22+
};

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CHANGELOG.md
2+
coverage

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"tabWidth": 2,
3+
"printWidth": 80,
4+
"semi": true,
5+
"trailingComma": "es5",
6+
"singleQuote": true,
7+
"endOfLine": "auto"
8+
}

index.js

Lines changed: 133 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,135 @@
11
module.exports = {
2-
parserPreset: 'conventional-changelog-conventionalcommits',
3-
rules: {
4-
'body-leading-blank': [1, 'always'],
5-
'body-max-line-length': [2, 'always', 100],
6-
'footer-leading-blank': [1, 'always'],
7-
'footer-max-line-length': [2, 'always', 100],
8-
'header-max-length': [2, 'always', 100],
9-
'subject-case': [
10-
2,
11-
'never',
12-
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
13-
],
14-
'subject-empty': [2, 'never'],
15-
'subject-full-stop': [2, 'never', '.'],
16-
'type-case': [2, 'always', 'lower-case'],
17-
'type-empty': [2, 'never'],
18-
'type-enum': [
19-
2,
20-
'always',
21-
[
22-
'build',
23-
'chore',
24-
'ci',
25-
'docs',
26-
'feat',
27-
'fix',
28-
'perf',
29-
'refactor',
30-
'revert',
31-
'style',
32-
'test',
33-
],
34-
],
35-
},
36-
prompt: {
37-
questions: {
38-
type: {
39-
description: "Select the type of change that you're committing",
40-
enum: {
41-
feat: {
42-
description: 'A new feature',
43-
title: 'Features',
44-
emoji: '✨',
45-
},
46-
fix: {
47-
description: 'A bug fix',
48-
title: 'Bug Fixes',
49-
emoji: '🐛',
50-
},
51-
docs: {
52-
description: 'Documentation only changes',
53-
title: 'Documentation',
54-
emoji: '📚',
55-
},
56-
style: {
57-
description:
58-
'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
59-
title: 'Styles',
60-
emoji: '💎',
61-
},
62-
refactor: {
63-
description:
64-
'A code change that neither fixes a bug nor adds a feature',
65-
title: 'Code Refactoring',
66-
emoji: '📦',
67-
},
68-
perf: {
69-
description: 'A code change that improves performance',
70-
title: 'Performance Improvements',
71-
emoji: '🚀',
72-
},
73-
test: {
74-
description: 'Adding missing tests or correcting existing tests',
75-
title: 'Tests',
76-
emoji: '🚨',
77-
},
78-
build: {
79-
description:
80-
'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)',
81-
title: 'Builds',
82-
emoji: '🛠',
83-
},
84-
ci: {
85-
description:
86-
'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)',
87-
title: 'Continuous Integrations',
88-
emoji: '⚙️',
89-
},
90-
chore: {
91-
description: "Other changes that don't modify src or test files",
92-
title: 'Chores',
93-
emoji: '♻️',
94-
},
95-
revert: {
96-
description: 'Reverts a previous commit',
97-
title: 'Reverts',
98-
emoji: '🗑',
99-
},
100-
},
101-
},
102-
scope: {
103-
description:
104-
'What is the scope of this change (e.g. component or file name)',
105-
},
106-
subject: {
107-
description:
108-
'Write a short, imperative tense description of the change',
109-
},
110-
body: {
111-
description: 'Provide a longer description of the change',
112-
},
113-
isBreaking: {
114-
description: 'Are there any breaking changes?',
115-
},
116-
breakingBody: {
117-
description:
118-
'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself',
119-
},
120-
breaking: {
121-
description: 'Describe the breaking changes',
122-
},
123-
isIssueAffected: {
124-
description: 'Does this change affect any open issues?',
125-
},
126-
issuesBody: {
127-
description:
128-
'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself',
129-
},
130-
issues: {
131-
description: 'Add issue references (e.g. "fix #123", "re #123".)',
132-
},
133-
},
134-
},
2+
parserPreset: 'conventional-changelog-conventionalcommits',
3+
rules: {
4+
'body-leading-blank': [1, 'always'],
5+
'body-max-line-length': [2, 'always', 100],
6+
'footer-leading-blank': [1, 'always'],
7+
'footer-max-line-length': [2, 'always', 100],
8+
'header-max-length': [2, 'always', 100],
9+
'subject-case': [
10+
2,
11+
'never',
12+
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
13+
],
14+
'subject-empty': [2, 'never'],
15+
'subject-full-stop': [2, 'never', '.'],
16+
'type-case': [2, 'always', 'lower-case'],
17+
'type-empty': [2, 'never'],
18+
'type-enum': [
19+
2,
20+
'always',
21+
[
22+
'build',
23+
'chore',
24+
'ci',
25+
'docs',
26+
'feat',
27+
'fix',
28+
'perf',
29+
'refactor',
30+
'revert',
31+
'style',
32+
'test',
33+
],
34+
],
35+
},
36+
prompt: {
37+
questions: {
38+
type: {
39+
description: "Select the type of change that you're committing",
40+
enum: {
41+
feat: {
42+
description: 'A new feature',
43+
title: 'Features',
44+
emoji: '✨',
45+
},
46+
fix: {
47+
description: 'A bug fix',
48+
title: 'Bug Fixes',
49+
emoji: '🐛',
50+
},
51+
docs: {
52+
description: 'Documentation only changes',
53+
title: 'Documentation',
54+
emoji: '📚',
55+
},
56+
style: {
57+
description:
58+
'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
59+
title: 'Styles',
60+
emoji: '💎',
61+
},
62+
refactor: {
63+
description:
64+
'A code change that neither fixes a bug nor adds a feature',
65+
title: 'Code Refactoring',
66+
emoji: '📦',
67+
},
68+
perf: {
69+
description: 'A code change that improves performance',
70+
title: 'Performance Improvements',
71+
emoji: '🚀',
72+
},
73+
test: {
74+
description: 'Adding missing tests or correcting existing tests',
75+
title: 'Tests',
76+
emoji: '🚨',
77+
},
78+
build: {
79+
description:
80+
'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)',
81+
title: 'Builds',
82+
emoji: '🛠',
83+
},
84+
ci: {
85+
description:
86+
'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)',
87+
title: 'Continuous Integrations',
88+
emoji: '⚙️',
89+
},
90+
chore: {
91+
description: "Other changes that don't modify src or test files",
92+
title: 'Chores',
93+
emoji: '♻️',
94+
},
95+
revert: {
96+
description: 'Reverts a previous commit',
97+
title: 'Reverts',
98+
emoji: '🗑',
99+
},
100+
},
101+
},
102+
scope: {
103+
description:
104+
'What is the scope of this change (e.g. component or file name)',
105+
},
106+
subject: {
107+
description:
108+
'Write a short, imperative tense description of the change',
109+
},
110+
body: {
111+
description: 'Provide a longer description of the change',
112+
},
113+
isBreaking: {
114+
description: 'Are there any breaking changes?',
115+
},
116+
breakingBody: {
117+
description:
118+
'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself',
119+
},
120+
breaking: {
121+
description: 'Describe the breaking changes',
122+
},
123+
isIssueAffected: {
124+
description: 'Does this change affect any open issues?',
125+
},
126+
issuesBody: {
127+
description:
128+
'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself',
129+
},
130+
issues: {
131+
description: 'Add issue references (e.g. "fix #123", "re #123".)',
132+
},
133+
},
134+
},
135135
};

0 commit comments

Comments
 (0)