Skip to content

Commit 46e40f5

Browse files
committed
chore(tools): add linting, fomatting and other tools
1 parent 5e2c24e commit 46e40f5

File tree

9 files changed

+7164
-3835
lines changed

9 files changed

+7164
-3835
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.webpack

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "freecodecamp"
3+
}

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "none"
5+
}

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ node_js:
66
cache:
77
directories:
88
- node_modules
9-
9+
script:
10+
- npm run lint
11+
- npm run test
1012
sudo: false

commitizen.config.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* eslint-env node */
2+
3+
const types = [
4+
{
5+
value: 'feat',
6+
name: 'feat: A new feature'
7+
},
8+
{
9+
value: 'fix',
10+
name: 'fix: A bug fix'
11+
},
12+
{
13+
value: 'docs',
14+
name: 'docs: Documentation only changes'
15+
},
16+
{
17+
value: 'style',
18+
name: `style: Changes that do not affect the meaning of the code
19+
(white-space, formatting, missing semi-colons, etc)`
20+
},
21+
{
22+
value: 'refactor',
23+
name: 'refactor: A code change that neither fixes a bug nor adds a feature'
24+
},
25+
{
26+
value: 'perf',
27+
name: 'perf: A code change that improves performance'
28+
},
29+
{
30+
value: 'test',
31+
name: 'test: Adding missing tests'
32+
},
33+
{
34+
value: 'chore',
35+
name: `chore: Changes to the build process or auxiliary tools
36+
and libraries such as documentation generation`
37+
},
38+
{
39+
value: 'revert',
40+
name: 'revert: Revert a commit'
41+
}
42+
];
43+
44+
const scopes = ['challenges', 'tools', 'scripts'].map(name => ({
45+
name
46+
}));
47+
48+
module.exports = {
49+
types,
50+
scopes,
51+
allowCustomScopes: true,
52+
allowBreakingChanges: ['feat', 'fix', 'perf', 'refactor']
53+
};

commitlint.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* eslint-env node */
2+
3+
const { types, scopes, allowCustomScopes } = require('./commitizen.config');
4+
5+
const validTypes = types.map(type => type.value);
6+
const validScopes = scopes.map(scope => scope.name);
7+
const scopeValidationLevel = allowCustomScopes ? 0 : 2;
8+
9+
module.exports = {
10+
extends: ['@commitlint/config-conventional'],
11+
12+
// Add your own rules. See http://marionebl.github.io/commitlint
13+
rules: {
14+
// Apply valid scopes and types
15+
'scope-enum': [scopeValidationLevel, 'always', validScopes],
16+
'type-enum': [2, 'always', validTypes],
17+
18+
// Disable subject-case rule
19+
'subject-case': [0, 'always'],
20+
21+
// Disable language rule
22+
lang: [0, 'always', 'eng']
23+
}
24+
};

0 commit comments

Comments
 (0)