Skip to content

Commit

Permalink
reformat code using prettier, add related dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
haveyaseen committed Oct 3, 2019
1 parent 72c68f2 commit a352c21
Show file tree
Hide file tree
Showing 80 changed files with 3,065 additions and 2,754 deletions.
8 changes: 2 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@
]
},
"cjs": {
"presets": [
"@babel/preset-env"
]
"presets": ["@babel/preset-env"]
},
"test": {
"plugins": [
"@babel/plugin-transform-modules-commonjs"
]
"plugins": ["@babel/plugin-transform-modules-commonjs"]
}
}
}
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
codecov:
#branch: master
#branch: master
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
indent_size = 2
28 changes: 0 additions & 28 deletions .eslintrc

This file was deleted.

27 changes: 27 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
extends: ['airbnb-base', 'plugin:prettier/recommended'],
parser: 'babel-eslint',
rules: {
'max-len': 0,
'id-length': 0,
'consistent-return': 1,
'class-methods-use-this': 0,
'comma-dangle': ['error', 'always-multiline'],
'no-unused-vars': ['error', { args: 'none' }],
'no-underscore-dangle': ['warn', { allowAfterThis: true }],
'no-param-reassign': ['error', { props: false }],
'no-prototype-builtins': 0,
'no-plusplus': 0,
'no-console': 0,
'prefer-rest-params': 0,
'import/no-named-as-default': 0,
'function-paren-newline': 0,
'operator-linebreak': 0,
'max-classes-per-file': ['warn', 1],
},
parserOptions: {
ecmaFeatures: {
ecmaVersion: 6,
},
},
};
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

19 changes: 19 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
tabWidth: 4,
semi: true,
singleQuote: false,
overrides: [
{
files: ["*.js", "*.mjs"],
options: {
trailingComma: "es5"
}
},
{
files: "*.json",
options: {
tabWidth: 2
}
}
]
};
18 changes: 10 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const { task, series, watch } = require('gulp');
const apiDocs = require('./tasks/api-docs');
const { task, series, watch } = require("gulp");

const apiDocs = require("./tasks/api-docs");

task("api-docs:clean", apiDocs.clean);
task("api-docs:build", apiDocs.build);
const apiDocsAll = series("api-docs:clean", "api-docs:build");

task('api-docs:clean', apiDocs.clean);
task('api-docs:build', apiDocs.build);
const apiDocsAll = series('api-docs:clean', 'api-docs:build');
function apiDocsWatch() {
watch(['src/**/*.js', 'tasks/api-docs/**/*'], apiDocsAll);
watch(["src/**/*.js", "tasks/api-docs/**/*"], apiDocsAll);
}

exports['api-docs'] = apiDocsAll;
exports['api-docs:watch'] = apiDocsWatch;
exports["api-docs"] = apiDocsAll;
exports["api-docs:watch"] = apiDocsWatch;
33 changes: 14 additions & 19 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
const path = require('path');
const path = require("path");

module.exports = {
rootDir: path.resolve('./src/'),
testRegex: 'test/(.*)/(.*)\\.(js)',
moduleFileExtensions: ['js', 'json'],
rootDir: path.resolve("./src/"),
testRegex: "test/(.*)/(.*)\\.(js)",
moduleFileExtensions: ["js", "json"],
testPathIgnorePatterns: [
'test/functional/es5\\.(js)',
'test/functional/performance\\.(js)',
"test/functional/es5\\.(js)",
"test/functional/performance\\.(js)",
],
transform: {
'\\.js$': 'babel-jest',
"\\.js$": "babel-jest",
},
coverageDirectory: '../coverage/',
coverageDirectory: "../coverage/",
collectCoverage: true,
collectCoverageFrom: [
'*.js',
'*/*.js',
],
coveragePathIgnorePatterns: [
'test/*',
],
collectCoverageFrom: ["*.js", "*/*.js"],
coveragePathIgnorePatterns: ["test/*"],
coverageThreshold: {
global: {
branches: 75,
functions: 80,
lines: 85,
statements: 85,
branches: 95,
functions: 100,
lines: 99,
statements: 99,
},
},
};
8 changes: 4 additions & 4 deletions jest.es5.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const path = require('path');
const path = require("path");

module.exports = {
rootDir: path.resolve('./src/'),
testRegex: 'test/functional/es5\\.(js)',
moduleFileExtensions: ['js', 'json'],
rootDir: path.resolve("./src/"),
testRegex: "test/functional/es5\\.(js)",
moduleFileExtensions: ["js", "json"],
transform: {},
collectCoverage: false,
};
10 changes: 5 additions & 5 deletions jest.perf.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const path = require('path');
const path = require("path");

module.exports = {
rootDir: path.resolve('./src/'),
testRegex: 'test/functional/performance\\.(js)',
moduleFileExtensions: ['js', 'json'],
rootDir: path.resolve("./src/"),
testRegex: "test/functional/performance\\.(js)",
moduleFileExtensions: ["js", "json"],
transform: {
'\\.js$': 'babel-jest',
"\\.js$": "babel-jest",
},
collectCoverage: false,
verbose: true,
Expand Down
34 changes: 16 additions & 18 deletions jsdoc.conf.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
{
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc","closure"]
},
"source": {
"includePattern": ".+\\.js(doc)?$",
"excludePattern": "test"
},
"markdown": {
"hardwrap": true
},
"plugins": [
"plugins/markdown"
],
"templates": {
"cleverLinks": true,
"monospaceLinks": false
}
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc", "closure"]
},
"source": {
"includePattern": ".+\\.js(doc)?$",
"excludePattern": "test"
},
"markdown": {
"hardwrap": true
},
"plugins": ["plugins/markdown"],
"templates": {
"cleverLinks": true,
"monospaceLinks": false
}
}
47 changes: 46 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@
"deep-freeze": "0.0.1",
"eslint": "^6.3.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.17.0",
"eslint-plugin-prettier": "^3.1.1",
"gulp": "^4.0.2",
"gulp-clean": "^0.4.0",
"gulp-gh-pages": "https://github.com/tekd/gulp-gh-pages/tarball/9ebafeb4011982c98038d8e90373fe7ed91e3f88",
Expand All @@ -75,6 +77,7 @@
"jsdoc": "^3.6.3",
"jsdoc-to-markdown": "^5.0.0",
"lodash-webpack-plugin": "^0.11.5",
"prettier": "^1.18.2",
"rimraf": "^3.0.0",
"webpack": "^4.39.3",
"webpack-cli": "^3.3.8",
Expand Down
Loading

0 comments on commit a352c21

Please sign in to comment.