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

chore: use @umijs/fabric #32

Merged
merged 1 commit into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@svgr/rollup": "^4.3.0",
"@typescript-eslint/eslint-plugin": "1.10.2",
"@typescript-eslint/parser": "1.10.2",
"@umijs/fabric": "^1.0.5",
"ajv": "6.10.0",
"autoprefixer": "9.6.0",
"babel-plugin-react-require": "3.1.1",
Expand Down
6 changes: 2 additions & 4 deletions src/preCommit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,18 @@ function runCmd(cmd: string, args: string[]) {

function getPrettierConfig() {
const prettierrcPath = join(cwd, '.prettierrc');
const templatePrettierrcPath = join(__dirname, '../template/.prettierrc');

if (existsSync(prettierrcPath)) {
return JSON.parse(readFileSync(prettierrcPath, 'utf-8')) || {};
} else {
const templateConfig = JSON.parse(readFileSync(templatePrettierrcPath, 'utf-8')) || {};
delete templateConfig.parser;
const templateConfig = require('@umijs/fabric/dist/prettier');
return templateConfig;
}
}

function getEsLintConfig() {
const lintPath = join(cwd, '.eslintrc.js');
const templateLintPath = join(__dirname, '../template/.eslintrc.js');
const templateLintPath = require.resolve('@umijs/fabric/dist/eslint');

if (existsSync(lintPath)) {
return lintPath;
Expand Down
70 changes: 0 additions & 70 deletions template/.eslintrc.js

This file was deleted.

7 changes: 0 additions & 7 deletions template/.prettierrc

This file was deleted.