Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Prettier and improve ESLint #51

Merged
merged 16 commits into from
Dec 15, 2019
Merged
17 changes: 0 additions & 17 deletions .eslintrc

This file was deleted.

35 changes: 35 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"env": {
"node": true
},
"extends": ["airbnb-base", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.lint.json"
},
"plugins": ["@typescript-eslint"],
"rules": {
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"ts": "never"
}
],
"import/no-extraneous-dependencies": [
"error",
{ "peerDependencies": true }
],
"no-duplicate-imports": "off",
"no-restricted-syntax": "off",
"no-unused-vars": "off"
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".ts"]
}
}
}
}
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/*.coffee
**/*.opts
**/*.gitignore
**/*.txt
**/*.css
**/*.scss
test/**/*.js
9 changes: 8 additions & 1 deletion book.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
"gitbook": "3.2.2",
"title": "mochapack",
"description": "mocha cli with webpack support",
"plugins": ["edit-link", "-search", "github", "anchors", "prism", "-highlight"],
"plugins": [
"edit-link",
"-search",
"github",
"anchors",
"prism",
"-highlight"
],
"pluginsConfig": {
"edit-link": {
"base": "https://github.com/sysgears/mochapack/tree/master",
Expand Down
22 changes: 18 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
"clean-lib": "del-cli \"lib/**\" \"!lib\" \"!lib/reporters\" \"!lib/utils.js\" \"!lib/entry.js\" \"!lib/reporters/base.js\"",
"clean-tmp": "del-cli \".tmp/**\"",
"build": "yarn run clean-lib && tsc",
"lint": "eslint src test bin --fix",
"format": "prettier {src,test}/**/* ./*.json --write --loglevel warn",
"lint": "eslint src/**/*.ts test/**/*.ts --fix",
"test": "yarn run clean-tmp && yarn run build && ts-mocha --timeout 10000 --recursive --require @babel/register --exit \"test/**/*.test.ts\"",
"cover": "cross-env BABEL_ENV=coverage nyc --reporter=lcov --reporter=text npm test",
"posttest": "yarn run lint",
"posttest": "yarn run format && yarn run lint",
"docs:clean": "del-cli _book",
"docs:prepare": "gitbook install",
"docs:build": "yarn run docs:clean && yarn run docs:prepare && gitbook build",
Expand Down Expand Up @@ -60,9 +61,13 @@
"@babel/preset-typescript": "^7.7.4",
"@babel/register": "^7.0.0",
"@babel/runtime": "^7.7.6",
"@types/chai": "^4.2.7",
"@types/lodash": "^4.14.149",
"@types/mocha": "^5.2.7",
"@types/node": "^12.12.17",
"@types/webpack": "^4.41.0",
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
"anymatch": "3.1.1",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.0",
Expand All @@ -75,8 +80,9 @@
"css-loader": "3.2.0",
"del": "5.1.0",
"del-cli": "3.0.0",
"eslint": "4.19.1",
"eslint": "^6.7.2",
"eslint-config-airbnb-base": "12.1.0",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-import": "^2.9.0",
"fs-extra": "5.0.0",
"gh-pages": "1.2.0",
Expand All @@ -90,6 +96,7 @@
"node-sass": "^4.11.0",
"np": "5.1.0",
"nyc": "14.1.1",
"prettier": "^1.19.1",
"sass-loader": "6.0.7",
"sinon": "7.5.0",
"strip-ansi": "^5.2.0",
Expand Down Expand Up @@ -130,11 +137,18 @@
]
},
"nyc": {
"extension": [".ts"],
"extension": [
".ts"
],
"include": [
"src/**/*.ts"
]
},
"prettier": {
"semi": false,
"singleQuote": true,
"endOfLine": "lf"
},
"resolutions": {
"js-yaml": ">=3.13.0",
"lodash.mergewith": ">=4.6.2",
Expand Down
Loading