chore(tools): add linting, fomatting and other tools
This commit is contained in:
committed by
mrugesh mohapatra
parent
5e2c24e3b8
commit
46e40f5aba
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
2
.eslintignore
Normal file
2
.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
.webpack
|
5
.prettierrc
Normal file
5
.prettierrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none"
|
||||||
|
}
|
@ -6,5 +6,7 @@ node_js:
|
|||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
|
script:
|
||||||
|
- npm run lint
|
||||||
|
- npm run test
|
||||||
sudo: false
|
sudo: false
|
||||||
|
53
commitizen.config.js
Normal file
53
commitizen.config.js
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
|
const types = [
|
||||||
|
{
|
||||||
|
value: 'feat',
|
||||||
|
name: 'feat: A new feature'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'fix',
|
||||||
|
name: 'fix: A bug fix'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'docs',
|
||||||
|
name: 'docs: Documentation only changes'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'style',
|
||||||
|
name: `style: Changes that do not affect the meaning of the code
|
||||||
|
(white-space, formatting, missing semi-colons, etc)`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'refactor',
|
||||||
|
name: 'refactor: A code change that neither fixes a bug nor adds a feature'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'perf',
|
||||||
|
name: 'perf: A code change that improves performance'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'test',
|
||||||
|
name: 'test: Adding missing tests'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'chore',
|
||||||
|
name: `chore: Changes to the build process or auxiliary tools
|
||||||
|
and libraries such as documentation generation`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'revert',
|
||||||
|
name: 'revert: Revert a commit'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const scopes = ['challenges', 'tools', 'scripts'].map(name => ({
|
||||||
|
name
|
||||||
|
}));
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
types,
|
||||||
|
scopes,
|
||||||
|
allowCustomScopes: true,
|
||||||
|
allowBreakingChanges: ['feat', 'fix', 'perf', 'refactor']
|
||||||
|
};
|
24
commitlint.config.js
Normal file
24
commitlint.config.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
|
const { types, scopes, allowCustomScopes } = require('./commitizen.config');
|
||||||
|
|
||||||
|
const validTypes = types.map(type => type.value);
|
||||||
|
const validScopes = scopes.map(scope => scope.name);
|
||||||
|
const scopeValidationLevel = allowCustomScopes ? 0 : 2;
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
extends: ['@commitlint/config-conventional'],
|
||||||
|
|
||||||
|
// Add your own rules. See http://marionebl.github.io/commitlint
|
||||||
|
rules: {
|
||||||
|
// Apply valid scopes and types
|
||||||
|
'scope-enum': [scopeValidationLevel, 'always', validScopes],
|
||||||
|
'type-enum': [2, 'always', validTypes],
|
||||||
|
|
||||||
|
// Disable subject-case rule
|
||||||
|
'subject-case': [0, 'always'],
|
||||||
|
|
||||||
|
// Disable language rule
|
||||||
|
lang: [0, 'always', 'eng']
|
||||||
|
}
|
||||||
|
};
|
3258
package-lock.json
generated
3258
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
90
package.json
90
package.json
@ -1,40 +1,45 @@
|
|||||||
{
|
{
|
||||||
"name": "@freecodecamp/curriculum",
|
"name": "@freecodecamp/curriculum",
|
||||||
"version": "1.0.2",
|
|
||||||
"description": "freeCodeCamp's curriculum seed files",
|
"description": "freeCodeCamp's curriculum seed files",
|
||||||
"main": "dist/index.js",
|
"license": "(BSD-3-Clause AND CC-BY-SA-4.0)",
|
||||||
"publishConfig": {
|
"author": "freeCodeCamp <team@freecodecamp.org>",
|
||||||
"access": "public"
|
"homepage": "https://github.com/freecodecamp/freecodecamp#readme",
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "npm run build:js && npm run build:json",
|
|
||||||
"build:json": "gulp json:minify",
|
|
||||||
"build:js": "gulp babel",
|
|
||||||
"prepack": "npm run build",
|
|
||||||
"unpack": "babel-node ./unpack.js",
|
|
||||||
"repack": "babel-node ./repack.js",
|
|
||||||
"test": "babel-node ./test-challenges.js | tap-spec",
|
|
||||||
"release": "np"
|
|
||||||
},
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/freecodecamp/freecodecamp.git"
|
"url": "git+https://github.com/freecodecamp/freecodecamp.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
|
||||||
"freecodecamp",
|
|
||||||
"curriculum",
|
|
||||||
"challenges",
|
|
||||||
"javascript",
|
|
||||||
"interview",
|
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"author": "freeCodeCamp <team@freecodecamp.org>",
|
|
||||||
"license": "(BSD-3-Clause AND CC-BY-SA-4.0)",
|
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/freecodecamp/freecodecamp/issues"
|
"url": "https://github.com/freecodecamp/freecodecamp/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/freecodecamp/freecodecamp#readme",
|
"version": "1.0.2",
|
||||||
|
"main": "dist/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "npm run build:js && npm run build:json",
|
||||||
|
"build:js": "gulp babel",
|
||||||
|
"build:json": "gulp json:minify",
|
||||||
|
"precommit": "lint-staged",
|
||||||
|
"commit": "git-cz",
|
||||||
|
"commitmsg": "commitlint -e",
|
||||||
|
"format": "prettier --write es5 './**/*.{js,json}' && npm run lint",
|
||||||
|
"lint": "eslint ./**/*.js --fix",
|
||||||
|
"prepack": "npm run build",
|
||||||
|
"release": "np",
|
||||||
|
"repack": "babel-node ./repack.js",
|
||||||
|
"test": "babel-node ./test-challenges.js | tap-spec",
|
||||||
|
"unpack": "babel-node ./unpack.js"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"commitizen": {
|
||||||
|
"path": "node_modules/cz-customizable"
|
||||||
|
},
|
||||||
|
"cz-customizable": {
|
||||||
|
"config": "commitizen.config.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@commitlint/cli": "^6.1.3",
|
||||||
|
"@commitlint/config-conventional": "^6.1.3",
|
||||||
"babel-cli": "^6.3.17",
|
"babel-cli": "^6.3.17",
|
||||||
"babel-plugin-add-module-exports": "^0.2.1",
|
"babel-plugin-add-module-exports": "^0.2.1",
|
||||||
"babel-plugin-lodash": "^3.2.11",
|
"babel-plugin-lodash": "^3.2.11",
|
||||||
@ -46,21 +51,52 @@
|
|||||||
"babel-preset-stage-3": "^6.24.1",
|
"babel-preset-stage-3": "^6.24.1",
|
||||||
"babel-standalone": "^6.26.0",
|
"babel-standalone": "^6.26.0",
|
||||||
"browserify": "^16.2.2",
|
"browserify": "^16.2.2",
|
||||||
|
"commitizen": "^2.9.6",
|
||||||
|
"cz-customizable": "^5.2.0",
|
||||||
|
"eslint": "^4.19.1",
|
||||||
|
"eslint-config-freecodecamp": "^1.1.1",
|
||||||
|
"eslint-plugin-import": "^2.11.0",
|
||||||
|
"eslint-plugin-prefer-object-spread": "^1.2.1",
|
||||||
|
"eslint-plugin-react": "^7.7.0",
|
||||||
"fs-extra": "^6.0.1",
|
"fs-extra": "^6.0.1",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-babel": "^7.0.1",
|
"gulp-babel": "^7.0.1",
|
||||||
"gulp-json-minify": "^1.2.2",
|
"gulp-json-minify": "^1.2.2",
|
||||||
"gulp-rename": "^1.2.3",
|
"gulp-rename": "^1.2.3",
|
||||||
"gulp-util": "^3.0.8",
|
"gulp-util": "^3.0.8",
|
||||||
|
"husky": "^0.14.3",
|
||||||
"joi": "^13.3.0",
|
"joi": "^13.3.0",
|
||||||
"joi-objectid": "^2.0.0",
|
"joi-objectid": "^2.0.0",
|
||||||
"jquery": "^3.3.1",
|
"jquery": "^3.3.1",
|
||||||
|
"lint-staged": "^7.2.0",
|
||||||
"lodash": "^4.17.10",
|
"lodash": "^4.17.10",
|
||||||
"np": "*",
|
"np": "*",
|
||||||
|
"prettier": "^1.13.5",
|
||||||
|
"prettier-package-json": "^1.6.0",
|
||||||
"rx": "^4.1.0",
|
"rx": "^4.1.0",
|
||||||
"tap-spec": "^4.1.1",
|
"tap-spec": "^4.1.1",
|
||||||
"tape": "^4.9.0",
|
"tape": "^4.9.0",
|
||||||
"validator": "^10.2.0"
|
"validator": "^10.2.0"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"keywords": [
|
||||||
|
"challenges",
|
||||||
|
"curriculum",
|
||||||
|
"freecodecamp",
|
||||||
|
"interview",
|
||||||
|
"javascript",
|
||||||
|
"json"
|
||||||
|
],
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"*.{js,json,css}": [
|
||||||
|
"prettier --write",
|
||||||
|
"git add"
|
||||||
|
],
|
||||||
|
"package.json": [
|
||||||
|
"prettier-package-json --write",
|
||||||
|
"git add"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user