mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-11-29 18:48:32 +08:00
style: update prettier
This commit is contained in:
parent
de01b413db
commit
d419f9c0d9
24
.babelrc
24
.babelrc
@ -1,16 +1,14 @@
|
||||
{
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": [
|
||||
["env", { "targets": { "node": "current" } }]
|
||||
],
|
||||
"plugins": [
|
||||
"transform-vue-jsx",
|
||||
"transform-object-assign",
|
||||
"transform-object-rest-spread",
|
||||
"transform-class-properties",
|
||||
"transform-runtime"
|
||||
]
|
||||
}
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": [["env", { "targets": { "node": "current" } }]],
|
||||
"plugins": [
|
||||
"transform-vue-jsx",
|
||||
"transform-object-assign",
|
||||
"transform-object-rest-spread",
|
||||
"transform-class-properties",
|
||||
"transform-runtime"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
59
.eslintrc
59
.eslintrc
@ -1,25 +1,36 @@
|
||||
{
|
||||
"root": true,
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"jasmine": true,
|
||||
"jest": true,
|
||||
"es6": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
},
|
||||
"extends": ["plugin:vue/recommended", "prettier"],
|
||||
"rules": {
|
||||
"comma-dangle": [2, "always-multiline"],
|
||||
"no-var": "error",
|
||||
"camelcase": "off",
|
||||
"no-extra-boolean-cast": "off",
|
||||
"semi": ["error", "always"],
|
||||
"vue/require-prop-types": "off",
|
||||
"vue/require-default-prop": "off",
|
||||
"vue/no-reserved-keys": "off",
|
||||
"vue/prop-name-casing": "off"
|
||||
}
|
||||
}
|
||||
"root": true,
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"jasmine": true,
|
||||
"jest": true,
|
||||
"es6": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
},
|
||||
"extends": ["plugin:vue/recommended", "prettier"],
|
||||
"plugins": ["markdown"],
|
||||
"rules": {
|
||||
"comma-dangle": [2, "always-multiline"],
|
||||
"no-var": "error",
|
||||
"camelcase": "off",
|
||||
"no-extra-boolean-cast": "off",
|
||||
"semi": ["error", "always"],
|
||||
"vue/require-prop-types": "off",
|
||||
"vue/require-default-prop": "off",
|
||||
"vue/no-reserved-keys": "off",
|
||||
"vue/prop-name-casing": "off",
|
||||
"vue/max-attributes-per-line": [
|
||||
2,
|
||||
{
|
||||
"singleline": 20,
|
||||
"multiline": {
|
||||
"max": 1,
|
||||
"allowFirstLine": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
40
.jest.js
40
.jest.js
@ -1,41 +1,31 @@
|
||||
const libDir = process.env.LIB_DIR;
|
||||
|
||||
const transformIgnorePatterns = [
|
||||
'/dist/', 'node_modules\/[^/]+?\/(?!(es|node_modules)\/)', // Ignore modules without es dir
|
||||
'/dist/',
|
||||
'node_modules/[^/]+?/(?!(es|node_modules)/)', // Ignore modules without es dir
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
testURL: 'http://localhost/',
|
||||
setupFiles: ['./tests/setup.js'],
|
||||
moduleFileExtensions: [
|
||||
"js",
|
||||
"jsx",
|
||||
"json",
|
||||
"vue",
|
||||
"md",
|
||||
"jpg"
|
||||
],
|
||||
moduleFileExtensions: ['js', 'jsx', 'json', 'vue', 'md', 'jpg'],
|
||||
modulePathIgnorePatterns: ['/_site/'],
|
||||
testPathIgnorePatterns: [
|
||||
'/node_modules/', 'node'
|
||||
],
|
||||
testPathIgnorePatterns: ['/node_modules/', 'node'],
|
||||
transform: {
|
||||
".*\\.(vue|md)$": "<rootDir>/node_modules/vue-jest",
|
||||
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
|
||||
"^.+\\.svg$": "<rootDir>/node_modules/jest-transform-stub"
|
||||
'.*\\.(vue|md)$': '<rootDir>/node_modules/vue-jest',
|
||||
'^.+\\.(js|jsx)$': '<rootDir>/node_modules/babel-jest',
|
||||
'^.+\\.svg$': '<rootDir>/node_modules/jest-transform-stub',
|
||||
},
|
||||
testRegex: libDir === 'dist'
|
||||
? 'demo\\.test\\.js$'
|
||||
: '.*\\.test\\.js$',
|
||||
testRegex: libDir === 'dist' ? 'demo\\.test\\.js$' : '.*\\.test\\.js$',
|
||||
moduleNameMapper: {
|
||||
"^@/(.*)$": "<rootDir>/$1",
|
||||
"ant-design-vue": "<rootDir>/components/index.js",
|
||||
"^vue$": "vue/dist/vue.common.js"
|
||||
'^@/(.*)$': '<rootDir>/$1',
|
||||
'ant-design-vue': '<rootDir>/components/index.js',
|
||||
'^vue$': 'vue/dist/vue.common.js',
|
||||
},
|
||||
snapshotSerializers: ["<rootDir>/node_modules/jest-serializer-vue"],
|
||||
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
||||
collectCoverage: process.env.COVERAGE === 'true',
|
||||
collectCoverageFrom: [
|
||||
"components/**/*.{js,jsx,vue}",
|
||||
'components/**/*.{js,jsx,vue}',
|
||||
'!components/*/style/index.{js,jsx}',
|
||||
'!components/style/*.{js,jsx}',
|
||||
'!components/*/locale/*.{js,jsx}',
|
||||
@ -46,7 +36,7 @@ module.exports = {
|
||||
'!components/align/**/*',
|
||||
'!components/trigger/**/*',
|
||||
'!components/style.js',
|
||||
"!**/node_modules/**"
|
||||
'!**/node_modules/**',
|
||||
],
|
||||
transformIgnorePatterns
|
||||
transformIgnorePatterns,
|
||||
};
|
||||
|
@ -1,9 +1,26 @@
|
||||
**/*.md
|
||||
**/*.svg
|
||||
**/*.ejs
|
||||
**/*.html
|
||||
package.json
|
||||
es/**
|
||||
lib/**
|
||||
_site/**
|
||||
dist/**
|
||||
lib/
|
||||
es/
|
||||
dist/
|
||||
_site/
|
||||
coverage/
|
||||
CNAME
|
||||
LICENSE
|
||||
yarn.lock
|
||||
netlify.toml
|
||||
yarn-error.log
|
||||
*.sh
|
||||
*.snap
|
||||
.gitignore
|
||||
.npmignore
|
||||
.prettierignore
|
||||
.DS_Store
|
||||
.editorconfig
|
||||
.eslintignore
|
||||
**/*.yml
|
||||
components/style/color/*.less
|
||||
**/assets
|
||||
.gitattributes
|
||||
.stylelintrc
|
||||
.vcmrc
|
||||
|
@ -11,4 +11,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
14
package.json
14
package.json
@ -36,12 +36,13 @@
|
||||
"pub-with-ci": "node antd-tools/cli/run.js pub-with-ci",
|
||||
"prepublish": "node antd-tools/cli/run.js guard",
|
||||
"pre-publish": "node ./scripts/prepub",
|
||||
"prettier": "prettier -c --write '**/*'",
|
||||
"pretty-quick": "pretty-quick",
|
||||
"dist": "node antd-tools/cli/run.js dist",
|
||||
"lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components",
|
||||
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
|
||||
"commitmsg": "commitlint -x @commitlint/config-conventional -e $GIT_PARAMS",
|
||||
"codecov": "codecov",
|
||||
"prettier": "node ./scripts/prettier.js",
|
||||
"postinstall": "node scripts/postinstall || echo \"ignore\""
|
||||
},
|
||||
"repository": {
|
||||
@ -57,6 +58,11 @@
|
||||
"lint",
|
||||
"prettier"
|
||||
],
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "pretty-quick --staged"
|
||||
}
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": ">=2.6.6",
|
||||
"vue-template-compiler": ">=2.6.6"
|
||||
@ -107,6 +113,7 @@
|
||||
"eslint": "^5.8.0",
|
||||
"eslint-config-prettier": "^3.0.1",
|
||||
"eslint-plugin-html": "^3.2.2",
|
||||
"eslint-plugin-markdown": "^1.0.0",
|
||||
"eslint-plugin-vue": "^5.1.0",
|
||||
"fetch-jsonp": "^1.1.3",
|
||||
"fs-extra": "^7.0.0",
|
||||
@ -140,7 +147,8 @@
|
||||
"postcss": "^7.0.6",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"pre-commit": "^1.2.2",
|
||||
"prettier": "^1.15.3",
|
||||
"prettier": "^1.18.2",
|
||||
"pretty-quick": "^1.11.1",
|
||||
"querystring": "^0.2.0",
|
||||
"raw-loader": "^1.0.0-beta.0",
|
||||
"reqwest": "^2.0.5",
|
||||
@ -215,4 +223,4 @@
|
||||
"lib/**/style/*",
|
||||
"*.less"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user