Skip to content

Commit a352c21

Browse files
committed
reformat code using prettier, add related dependencies
1 parent 72c68f2 commit a352c21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3065
-2754
lines changed

.babelrc

+2-6
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@
3535
]
3636
},
3737
"cjs": {
38-
"presets": [
39-
"@babel/preset-env"
40-
]
38+
"presets": ["@babel/preset-env"]
4139
},
4240
"test": {
43-
"plugins": [
44-
"@babel/plugin-transform-modules-commonjs"
45-
]
41+
"plugins": ["@babel/plugin-transform-modules-commonjs"]
4642
}
4743
}
4844
}

.codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
codecov:
2-
#branch: master
2+
#branch: master

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
indent_size = 4
5+
indent_style = space
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.json]
10+
indent_size = 2

.eslintrc

-28
This file was deleted.

.eslintrc.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
extends: ['airbnb-base', 'plugin:prettier/recommended'],
3+
parser: 'babel-eslint',
4+
rules: {
5+
'max-len': 0,
6+
'id-length': 0,
7+
'consistent-return': 1,
8+
'class-methods-use-this': 0,
9+
'comma-dangle': ['error', 'always-multiline'],
10+
'no-unused-vars': ['error', { args: 'none' }],
11+
'no-underscore-dangle': ['warn', { allowAfterThis: true }],
12+
'no-param-reassign': ['error', { props: false }],
13+
'no-prototype-builtins': 0,
14+
'no-plusplus': 0,
15+
'no-console': 0,
16+
'prefer-rest-params': 0,
17+
'import/no-named-as-default': 0,
18+
'function-paren-newline': 0,
19+
'operator-linebreak': 0,
20+
'max-classes-per-file': ['warn', 1],
21+
},
22+
parserOptions: {
23+
ecmaFeatures: {
24+
ecmaVersion: 6,
25+
},
26+
},
27+
};

.prettierrc

-6
This file was deleted.

.prettierrc.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
tabWidth: 4,
3+
semi: true,
4+
singleQuote: false,
5+
overrides: [
6+
{
7+
files: ["*.js", "*.mjs"],
8+
options: {
9+
trailingComma: "es5"
10+
}
11+
},
12+
{
13+
files: "*.json",
14+
options: {
15+
tabWidth: 2
16+
}
17+
}
18+
]
19+
};

gulpfile.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
const { task, series, watch } = require('gulp');
2-
const apiDocs = require('./tasks/api-docs');
1+
const { task, series, watch } = require("gulp");
2+
3+
const apiDocs = require("./tasks/api-docs");
4+
5+
task("api-docs:clean", apiDocs.clean);
6+
task("api-docs:build", apiDocs.build);
7+
const apiDocsAll = series("api-docs:clean", "api-docs:build");
38

4-
task('api-docs:clean', apiDocs.clean);
5-
task('api-docs:build', apiDocs.build);
6-
const apiDocsAll = series('api-docs:clean', 'api-docs:build');
79
function apiDocsWatch() {
8-
watch(['src/**/*.js', 'tasks/api-docs/**/*'], apiDocsAll);
10+
watch(["src/**/*.js", "tasks/api-docs/**/*"], apiDocsAll);
911
}
1012

11-
exports['api-docs'] = apiDocsAll;
12-
exports['api-docs:watch'] = apiDocsWatch;
13+
exports["api-docs"] = apiDocsAll;
14+
exports["api-docs:watch"] = apiDocsWatch;

jest.config.js

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
1-
const path = require('path');
1+
const path = require("path");
22

33
module.exports = {
4-
rootDir: path.resolve('./src/'),
5-
testRegex: 'test/(.*)/(.*)\\.(js)',
6-
moduleFileExtensions: ['js', 'json'],
4+
rootDir: path.resolve("./src/"),
5+
testRegex: "test/(.*)/(.*)\\.(js)",
6+
moduleFileExtensions: ["js", "json"],
77
testPathIgnorePatterns: [
8-
'test/functional/es5\\.(js)',
9-
'test/functional/performance\\.(js)',
8+
"test/functional/es5\\.(js)",
9+
"test/functional/performance\\.(js)",
1010
],
1111
transform: {
12-
'\\.js$': 'babel-jest',
12+
"\\.js$": "babel-jest",
1313
},
14-
coverageDirectory: '../coverage/',
14+
coverageDirectory: "../coverage/",
1515
collectCoverage: true,
16-
collectCoverageFrom: [
17-
'*.js',
18-
'*/*.js',
19-
],
20-
coveragePathIgnorePatterns: [
21-
'test/*',
22-
],
16+
collectCoverageFrom: ["*.js", "*/*.js"],
17+
coveragePathIgnorePatterns: ["test/*"],
2318
coverageThreshold: {
2419
global: {
25-
branches: 75,
26-
functions: 80,
27-
lines: 85,
28-
statements: 85,
20+
branches: 95,
21+
functions: 100,
22+
lines: 99,
23+
statements: 99,
2924
},
3025
},
3126
};

jest.es5.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const path = require('path');
1+
const path = require("path");
22

33
module.exports = {
4-
rootDir: path.resolve('./src/'),
5-
testRegex: 'test/functional/es5\\.(js)',
6-
moduleFileExtensions: ['js', 'json'],
4+
rootDir: path.resolve("./src/"),
5+
testRegex: "test/functional/es5\\.(js)",
6+
moduleFileExtensions: ["js", "json"],
77
transform: {},
88
collectCoverage: false,
99
};

jest.perf.config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const path = require('path');
1+
const path = require("path");
22

33
module.exports = {
4-
rootDir: path.resolve('./src/'),
5-
testRegex: 'test/functional/performance\\.(js)',
6-
moduleFileExtensions: ['js', 'json'],
4+
rootDir: path.resolve("./src/"),
5+
testRegex: "test/functional/performance\\.(js)",
6+
moduleFileExtensions: ["js", "json"],
77
transform: {
8-
'\\.js$': 'babel-jest',
8+
"\\.js$": "babel-jest",
99
},
1010
collectCoverage: false,
1111
verbose: true,

jsdoc.conf.json

+16-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{
2-
"tags": {
3-
"allowUnknownTags": true,
4-
"dictionaries": ["jsdoc","closure"]
5-
},
6-
"source": {
7-
"includePattern": ".+\\.js(doc)?$",
8-
"excludePattern": "test"
9-
},
10-
"markdown": {
11-
"hardwrap": true
12-
},
13-
"plugins": [
14-
"plugins/markdown"
15-
],
16-
"templates": {
17-
"cleverLinks": true,
18-
"monospaceLinks": false
19-
}
2+
"tags": {
3+
"allowUnknownTags": true,
4+
"dictionaries": ["jsdoc", "closure"]
5+
},
6+
"source": {
7+
"includePattern": ".+\\.js(doc)?$",
8+
"excludePattern": "test"
9+
},
10+
"markdown": {
11+
"hardwrap": true
12+
},
13+
"plugins": ["plugins/markdown"],
14+
"templates": {
15+
"cleverLinks": true,
16+
"monospaceLinks": false
17+
}
2018
}

package-lock.json

+46-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@
6464
"deep-freeze": "0.0.1",
6565
"eslint": "^6.3.0",
6666
"eslint-config-airbnb-base": "^14.0.0",
67+
"eslint-config-prettier": "^6.3.0",
6768
"eslint-plugin-import": "^2.18.2",
6869
"eslint-plugin-jest": "^22.17.0",
70+
"eslint-plugin-prettier": "^3.1.1",
6971
"gulp": "^4.0.2",
7072
"gulp-clean": "^0.4.0",
7173
"gulp-gh-pages": "https://github.com/tekd/gulp-gh-pages/tarball/9ebafeb4011982c98038d8e90373fe7ed91e3f88",
@@ -75,6 +77,7 @@
7577
"jsdoc": "^3.6.3",
7678
"jsdoc-to-markdown": "^5.0.0",
7779
"lodash-webpack-plugin": "^0.11.5",
80+
"prettier": "^1.18.2",
7881
"rimraf": "^3.0.0",
7982
"webpack": "^4.39.3",
8083
"webpack-cli": "^3.3.8",

0 commit comments

Comments
 (0)