forked from jd-opensource/taro-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move out eslint stylelint commitlint config
- Loading branch information
1 parent
5737848
commit 4cbbc72
Showing
4 changed files
with
135 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"extends": [ | ||
"o2team", | ||
"plugin:react/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "babel-eslint", | ||
"plugins": [ | ||
"react" | ||
], | ||
"env": { | ||
"jest": true | ||
}, | ||
"rules": { | ||
"class-methods-use-this": "off", | ||
"prefer-rest-params": "off", | ||
"arrow-body-style": "warn", | ||
"taro/custom-component-children": "off", | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"varsIgnorePattern": "React" | ||
} | ||
], | ||
"no-console": [ | ||
"error", | ||
{ | ||
"allow": [ | ||
"warn", | ||
"error" | ||
] | ||
} | ||
] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"build/*.js" | ||
], | ||
"rules": { | ||
"import/no-commonjs": "off" | ||
} | ||
}, | ||
{ | ||
"files": [ | ||
"test/**/*.test.js", | ||
"test/**/test.js" | ||
], | ||
"rules": { | ||
"taro/no-stateless-component": "off", | ||
"react/react-in-jsx-scope": "off", | ||
"react/no-find-dom-node": "off", | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"varsIgnorePattern": "Nerv" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": [ | ||
"**/*.ts", | ||
"**/*.tsx" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"react", | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"env": { | ||
"jest": true | ||
}, | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": [ | ||
"off" | ||
], | ||
"@typescript-eslint/member-delimiter-style": [ | ||
"off" | ||
], | ||
"class-methods-use-this": "off", | ||
"prefer-rest-params": "off", | ||
"arrow-body-style": "warn", | ||
"react/jsx-filename-extension": [ | ||
2, | ||
{ | ||
"extensions": [ | ||
".js", | ||
".jsx", | ||
".ts", | ||
".tsx" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"extends": "stylelint-config-standard", | ||
"plugins": [ | ||
"stylelint-scss" | ||
], | ||
"rules": { | ||
"declaration-colon-newline-after": null, | ||
"at-rule-no-unknown": null, | ||
"color-hex-case": null, | ||
"block-closing-brace-newline-after": null, | ||
"at-rule-empty-line-before": null, | ||
"number-no-trailing-zeros": null, | ||
"no-empty-source": null, | ||
"unit-case": null, | ||
"scss/at-rule-no-unknown": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'type-empty': [2, 'never'], | ||
'type-case': [2, 'always', 'lower-case'], | ||
'subject-empty': [2, 'never'], | ||
'type-enum': [ | ||
2, | ||
'always', | ||
['feat', 'fix', 'docs', 'style', 'refactor', 'test', 'chore'] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,177 +28,6 @@ | |
"url": "[email protected]:nervjs/taro-ui.git" | ||
}, | ||
"license": "MIT", | ||
"eslintConfig": { | ||
"extends": [ | ||
"o2team", | ||
"plugin:react/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "babel-eslint", | ||
"plugins": [ | ||
"react" | ||
], | ||
"env": { | ||
"jest": true | ||
}, | ||
"rules": { | ||
"class-methods-use-this": "off", | ||
"prefer-rest-params": "off", | ||
"arrow-body-style": "warn", | ||
"taro/custom-component-children": "off", | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"varsIgnorePattern": "React" | ||
} | ||
], | ||
"no-console": [ | ||
"error", | ||
{ | ||
"allow": [ | ||
"warn", | ||
"error" | ||
] | ||
} | ||
] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"build/*.js" | ||
], | ||
"rules": { | ||
"import/no-commonjs": "off" | ||
} | ||
}, | ||
{ | ||
"files": [ | ||
"test/**/*.test.js", | ||
"test/**/test.js" | ||
], | ||
"rules": { | ||
"taro/no-stateless-component": "off", | ||
"react/react-in-jsx-scope": "off", | ||
"react/no-find-dom-node": "off", | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"varsIgnorePattern": "Nerv" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": [ | ||
"**/*.ts", | ||
"**/*.tsx" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"react", | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"env": { | ||
"jest": true | ||
}, | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": [ | ||
"off" | ||
], | ||
"@typescript-eslint/member-delimiter-style": [ | ||
"off" | ||
], | ||
"class-methods-use-this": "off", | ||
"prefer-rest-params": "off", | ||
"arrow-body-style": "warn", | ||
"react/jsx-filename-extension": [ | ||
2, | ||
{ | ||
"extensions": [ | ||
".js", | ||
".jsx", | ||
".ts", | ||
".tsx" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"stylelint": { | ||
"extends": "stylelint-config-standard", | ||
"plugins": [ | ||
"stylelint-scss" | ||
], | ||
"rules": { | ||
"declaration-colon-newline-after": null, | ||
"at-rule-no-unknown": null, | ||
"color-hex-case": null, | ||
"block-closing-brace-newline-after": null, | ||
"at-rule-empty-line-before": null, | ||
"number-no-trailing-zeros": null, | ||
"no-empty-source": null, | ||
"unit-case": null, | ||
"scss/at-rule-no-unknown": true | ||
} | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
], | ||
"rules": { | ||
"type-empty": [ | ||
2, | ||
"never" | ||
], | ||
"type-case": [ | ||
2, | ||
"always", | ||
"lower-case" | ||
], | ||
"subject-empty": [ | ||
2, | ||
"never" | ||
], | ||
"type-enum": [ | ||
2, | ||
"always", | ||
[ | ||
"feat", | ||
"fix", | ||
"docs", | ||
"style", | ||
"refactor", | ||
"test", | ||
"chore" | ||
] | ||
] | ||
} | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged", | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx,ts,tsx}": [ | ||
"eslint --quiet --cache --fix", | ||
"git add" | ||
], | ||
"src/**/*.scss": [ | ||
"stylelint --syntax scss --fix", | ||
"git add" | ||
] | ||
}, | ||
"scripts": { | ||
"dev:weapp": "yarn run build:weapp -- --watch", | ||
"dev:qq": "yarn run build:qq -- --watch", | ||
|