Use own package to lint code

This commit is contained in:
ErickSkrauch 2019-05-24 19:04:47 +03:00
parent 9a9b9dae7d
commit 31c531f151
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
4 changed files with 39 additions and 1 deletions

26
.eslintrc.js Normal file
View File

@ -0,0 +1,26 @@
module.exports = {
extends: [
'plugin:@elyby/config',
],
env: {
node: true,
es6: true,
},
settings: {
react: {
// Override these settings to avoid a wall of warnings
version: 'latest',
},
},
overrides: [
{
files: ['src/configs/*.ts'],
rules: {
'quote-props': 'off',
},
},
],
};

View File

@ -9,6 +9,7 @@ cache:
script: script:
- yarn tsc - yarn tsc
- yarn lint
- yarn test - yarn test
- yarn build - yarn build

View File

@ -22,7 +22,8 @@
}, },
"scripts": { "scripts": {
"build": "babel src -d lib --extensions .ts,.js", "build": "babel src -d lib --extensions .ts,.js",
"test": "jest" "test": "jest",
"lint": "eslint \"{src,tests}/**/*.{js,ts}\""
}, },
"dependencies": { "dependencies": {
"@typescript-eslint/eslint-plugin": "^1.9.0", "@typescript-eslint/eslint-plugin": "^1.9.0",
@ -34,6 +35,7 @@
"@babel/core": "^7.4.5", "@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.4", "@babel/preset-env": "^7.4.4",
"@babel/preset-typescript": "^7.3.3", "@babel/preset-typescript": "^7.3.3",
"@elyby/eslint-plugin": "^0.1.0",
"@types/eslint": "^4.16.6", "@types/eslint": "^4.16.6",
"@types/estree": "^0.0.39", "@types/estree": "^0.0.39",
"@types/node": "^12.0.2", "@types/node": "^12.0.2",

View File

@ -666,6 +666,15 @@
exec-sh "^0.3.2" exec-sh "^0.3.2"
minimist "^1.2.0" minimist "^1.2.0"
"@elyby/eslint-plugin@^0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@elyby/eslint-plugin/-/eslint-plugin-0.1.0.tgz#02e1860b8d176dca8dac982e2d3b1837dd6ad293"
integrity sha512-P/mv8wj6E3YbdR7N+f/pPWDZlKIHvVHH7ruOjyRMuGElMWnXycFv3tqA0xJgPE1gTCaa8NYg6jbk6Q8l/d/7xw==
dependencies:
"@typescript-eslint/eslint-plugin" "^1.9.0"
"@typescript-eslint/parser" "^1.9.0"
eslint-plugin-react "^7.13.0"
"@jest/console@^24.7.1": "@jest/console@^24.7.1":
version "24.7.1" version "24.7.1"
resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545"