Skip to content

Commit 3a5585e

Browse files
authored
ci(setup): Add essential configs (#1)
1 parent bfc08bf commit 3a5585e

12 files changed

+19427
-2
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
coverage
3+
dist

.eslintrc

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"airbnb-base",
5+
"plugin:import/recommended",
6+
"prettier"
7+
],
8+
"plugins": ["prettier", "import"],
9+
"parserOptions": {
10+
"sourceType": "module",
11+
"ecmaVersion": 2020
12+
},
13+
"env": {
14+
"node": true
15+
},
16+
"rules": {
17+
"no-console": ["off"],
18+
"no-await-in-loop": ["off"],
19+
"import/order": [
20+
"error",
21+
{
22+
"newlines-between": "always",
23+
"alphabetize": { "order": "asc", "caseInsensitive": true }
24+
}
25+
],
26+
"prettier/prettier": ["error"]
27+
},
28+
"overrides": [
29+
{
30+
"files": ["tests/**", "*.test.js", "*.spec.js"],
31+
"env": {
32+
"jest": true
33+
}
34+
}
35+
]
36+
}

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
coverage
3+
dist
4+
5+
*.log
6+

.lintstagedrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"*.{js}": [
3+
"eslint --quiet --fix"
4+
],
5+
"*.{json,md,html}": [
6+
"prettier --write"
7+
]
8+
}

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16.16.0

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
coverage
3+
dist

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"singleQuote": true,
3+
"semi": true,
4+
"printWidth": 80,
5+
"trailingComma": "none"
6+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 syJSdev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [['@babel/preset-env', { targets: { node: 'current' } }]]
3+
};

jest.config.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* For a detailed explanation regarding each configuration property, visit:
3+
* https://jestjs.io/docs/configuration
4+
*/
5+
6+
module.exports = {
7+
// Automatically clear mock calls, instances, contexts and results before every test
8+
clearMocks: true,
9+
10+
// Indicates whether the coverage information should be collected while executing the test
11+
collectCoverage: true,
12+
13+
// The directory where Jest should output its coverage files
14+
coverageDirectory: 'coverage',
15+
16+
// A list of paths to directories that Jest should use to search for files in
17+
roots: ['<rootDir>/src', '<rootDir>/tests'],
18+
19+
// Indicates whether each individual test should be reported during the run
20+
verbose: true,
21+
22+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
23+
watchPathIgnorePatterns: [
24+
'<rootDir>/tests/fixtures/build',
25+
'<rootDir>/tests/fixtures/dist',
26+
'<rootDir>/tests/fixtures/src/index.js'
27+
]
28+
};

0 commit comments

Comments
 (0)