style: update prettier
parent
de01b413db
commit
d419f9c0d9
4
.babelrc
4
.babelrc
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"env": {
|
"env": {
|
||||||
"test": {
|
"test": {
|
||||||
"presets": [
|
"presets": [["env", { "targets": { "node": "current" } }]],
|
||||||
["env", { "targets": { "node": "current" } }]
|
|
||||||
],
|
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"transform-vue-jsx",
|
"transform-vue-jsx",
|
||||||
"transform-object-assign",
|
"transform-object-assign",
|
||||||
|
|
13
.eslintrc
13
.eslintrc
|
@ -11,6 +11,7 @@
|
||||||
"parser": "babel-eslint"
|
"parser": "babel-eslint"
|
||||||
},
|
},
|
||||||
"extends": ["plugin:vue/recommended", "prettier"],
|
"extends": ["plugin:vue/recommended", "prettier"],
|
||||||
|
"plugins": ["markdown"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"comma-dangle": [2, "always-multiline"],
|
"comma-dangle": [2, "always-multiline"],
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
|
@ -20,6 +21,16 @@
|
||||||
"vue/require-prop-types": "off",
|
"vue/require-prop-types": "off",
|
||||||
"vue/require-default-prop": "off",
|
"vue/require-default-prop": "off",
|
||||||
"vue/no-reserved-keys": "off",
|
"vue/no-reserved-keys": "off",
|
||||||
"vue/prop-name-casing": "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 libDir = process.env.LIB_DIR;
|
||||||
|
|
||||||
const transformIgnorePatterns = [
|
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 = {
|
module.exports = {
|
||||||
testURL: 'http://localhost/',
|
testURL: 'http://localhost/',
|
||||||
setupFiles: ['./tests/setup.js'],
|
setupFiles: ['./tests/setup.js'],
|
||||||
moduleFileExtensions: [
|
moduleFileExtensions: ['js', 'jsx', 'json', 'vue', 'md', 'jpg'],
|
||||||
"js",
|
|
||||||
"jsx",
|
|
||||||
"json",
|
|
||||||
"vue",
|
|
||||||
"md",
|
|
||||||
"jpg"
|
|
||||||
],
|
|
||||||
modulePathIgnorePatterns: ['/_site/'],
|
modulePathIgnorePatterns: ['/_site/'],
|
||||||
testPathIgnorePatterns: [
|
testPathIgnorePatterns: ['/node_modules/', 'node'],
|
||||||
'/node_modules/', 'node'
|
|
||||||
],
|
|
||||||
transform: {
|
transform: {
|
||||||
".*\\.(vue|md)$": "<rootDir>/node_modules/vue-jest",
|
'.*\\.(vue|md)$': '<rootDir>/node_modules/vue-jest',
|
||||||
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
|
'^.+\\.(js|jsx)$': '<rootDir>/node_modules/babel-jest',
|
||||||
"^.+\\.svg$": "<rootDir>/node_modules/jest-transform-stub"
|
'^.+\\.svg$': '<rootDir>/node_modules/jest-transform-stub',
|
||||||
},
|
},
|
||||||
testRegex: libDir === 'dist'
|
testRegex: libDir === 'dist' ? 'demo\\.test\\.js$' : '.*\\.test\\.js$',
|
||||||
? 'demo\\.test\\.js$'
|
|
||||||
: '.*\\.test\\.js$',
|
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
"^@/(.*)$": "<rootDir>/$1",
|
'^@/(.*)$': '<rootDir>/$1',
|
||||||
"ant-design-vue": "<rootDir>/components/index.js",
|
'ant-design-vue': '<rootDir>/components/index.js',
|
||||||
"^vue$": "vue/dist/vue.common.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',
|
collectCoverage: process.env.COVERAGE === 'true',
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
"components/**/*.{js,jsx,vue}",
|
'components/**/*.{js,jsx,vue}',
|
||||||
'!components/*/style/index.{js,jsx}',
|
'!components/*/style/index.{js,jsx}',
|
||||||
'!components/style/*.{js,jsx}',
|
'!components/style/*.{js,jsx}',
|
||||||
'!components/*/locale/*.{js,jsx}',
|
'!components/*/locale/*.{js,jsx}',
|
||||||
|
@ -46,7 +36,7 @@ module.exports = {
|
||||||
'!components/align/**/*',
|
'!components/align/**/*',
|
||||||
'!components/trigger/**/*',
|
'!components/trigger/**/*',
|
||||||
'!components/style.js',
|
'!components/style.js',
|
||||||
"!**/node_modules/**"
|
'!**/node_modules/**',
|
||||||
],
|
],
|
||||||
transformIgnorePatterns
|
transformIgnorePatterns,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,9 +1,26 @@
|
||||||
**/*.md
|
|
||||||
**/*.svg
|
**/*.svg
|
||||||
**/*.ejs
|
|
||||||
**/*.html
|
|
||||||
package.json
|
package.json
|
||||||
es/**
|
lib/
|
||||||
lib/**
|
es/
|
||||||
_site/**
|
dist/
|
||||||
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
|
||||||
|
|
12
package.json
12
package.json
|
@ -36,12 +36,13 @@
|
||||||
"pub-with-ci": "node antd-tools/cli/run.js pub-with-ci",
|
"pub-with-ci": "node antd-tools/cli/run.js pub-with-ci",
|
||||||
"prepublish": "node antd-tools/cli/run.js guard",
|
"prepublish": "node antd-tools/cli/run.js guard",
|
||||||
"pre-publish": "node ./scripts/prepub",
|
"pre-publish": "node ./scripts/prepub",
|
||||||
|
"prettier": "prettier -c --write '**/*'",
|
||||||
|
"pretty-quick": "pretty-quick",
|
||||||
"dist": "node antd-tools/cli/run.js dist",
|
"dist": "node antd-tools/cli/run.js dist",
|
||||||
"lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components",
|
"lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components",
|
||||||
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
|
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
|
||||||
"commitmsg": "commitlint -x @commitlint/config-conventional -e $GIT_PARAMS",
|
"commitmsg": "commitlint -x @commitlint/config-conventional -e $GIT_PARAMS",
|
||||||
"codecov": "codecov",
|
"codecov": "codecov",
|
||||||
"prettier": "node ./scripts/prettier.js",
|
|
||||||
"postinstall": "node scripts/postinstall || echo \"ignore\""
|
"postinstall": "node scripts/postinstall || echo \"ignore\""
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -57,6 +58,11 @@
|
||||||
"lint",
|
"lint",
|
||||||
"prettier"
|
"prettier"
|
||||||
],
|
],
|
||||||
|
"husky": {
|
||||||
|
"hooks": {
|
||||||
|
"pre-commit": "pretty-quick --staged"
|
||||||
|
}
|
||||||
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vue": ">=2.6.6",
|
"vue": ">=2.6.6",
|
||||||
"vue-template-compiler": ">=2.6.6"
|
"vue-template-compiler": ">=2.6.6"
|
||||||
|
@ -107,6 +113,7 @@
|
||||||
"eslint": "^5.8.0",
|
"eslint": "^5.8.0",
|
||||||
"eslint-config-prettier": "^3.0.1",
|
"eslint-config-prettier": "^3.0.1",
|
||||||
"eslint-plugin-html": "^3.2.2",
|
"eslint-plugin-html": "^3.2.2",
|
||||||
|
"eslint-plugin-markdown": "^1.0.0",
|
||||||
"eslint-plugin-vue": "^5.1.0",
|
"eslint-plugin-vue": "^5.1.0",
|
||||||
"fetch-jsonp": "^1.1.3",
|
"fetch-jsonp": "^1.1.3",
|
||||||
"fs-extra": "^7.0.0",
|
"fs-extra": "^7.0.0",
|
||||||
|
@ -140,7 +147,8 @@
|
||||||
"postcss": "^7.0.6",
|
"postcss": "^7.0.6",
|
||||||
"postcss-loader": "^3.0.0",
|
"postcss-loader": "^3.0.0",
|
||||||
"pre-commit": "^1.2.2",
|
"pre-commit": "^1.2.2",
|
||||||
"prettier": "^1.15.3",
|
"prettier": "^1.18.2",
|
||||||
|
"pretty-quick": "^1.11.1",
|
||||||
"querystring": "^0.2.0",
|
"querystring": "^0.2.0",
|
||||||
"raw-loader": "^1.0.0-beta.0",
|
"raw-loader": "^1.0.0-beta.0",
|
||||||
"reqwest": "^2.0.5",
|
"reqwest": "^2.0.5",
|
||||||
|
|
Loading…
Reference in New Issue