Skip to content

Commit 33c7230

Browse files
committed
style: update prettier & format code
1 parent fdecafb commit 33c7230

File tree

113 files changed

+333
-424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+333
-424
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"parser": "babel-eslint"
1212
},
1313
"extends": ["plugin:vue/vue3-recommended", "prettier"],
14-
"plugins": ["markdown"],
14+
"plugins": ["markdown", "jest"],
1515
"overrides": [
1616
{
1717
"files": ["**/demo/*.md"],

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"trailingComma": "all",
44
"printWidth": 100,
55
"proseWrap": "never",
6+
"arrowParens": "avoid",
67
"overrides": [
78
{
89
"files": ".prettierrc",

antd-tools/getBabelCommonConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { resolve } = require('./utils/projectHelper');
22

3-
module.exports = function(modules) {
3+
module.exports = function (modules) {
44
const plugins = [
55
[
66
resolve('@babel/plugin-transform-typescript'),

antd-tools/getTSCommonConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const fs = require('fs');
44
const assign = require('object-assign');
55
const { getProjectPath } = require('./utils/projectHelper');
66

7-
module.exports = function() {
7+
module.exports = function () {
88
let my = {};
99
if (fs.existsSync(getProjectPath('tsconfig.json'))) {
1010
my = require(getProjectPath('tsconfig.json'));

antd-tools/gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function compileTs(stream) {
8080
return stream
8181
.pipe(ts(tsConfig))
8282
.js.pipe(
83-
through2.obj(function(file, encoding, next) {
83+
through2.obj(function (file, encoding, next) {
8484
// console.log(file.path, file.base);
8585
file.path = file.path.replace(/\.[jt]sx$/, '.js');
8686
this.push(file);
@@ -146,7 +146,7 @@ function compile(modules) {
146146
const less = gulp
147147
.src(['components/**/*.less'])
148148
.pipe(
149-
through2.obj(function(file, encoding, next) {
149+
through2.obj(function (file, encoding, next) {
150150
this.push(file.clone());
151151
if (
152152
file.path.match(/\/style\/index\.less$/) ||

antd-tools/utils/getChangelog.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
const fs = require('fs');
22

33
module.exports = function getChangelog(file, version) {
4-
const lines = fs
5-
.readFileSync(file)
6-
.toString()
7-
.split('\n');
4+
const lines = fs.readFileSync(file).toString().split('\n');
85
const changeLog = [];
96
const startPattern = new RegExp(`^## ${version}`);
107
const stopPattern = /^## /; // 前一个版本

antd-tools/utils/getRunCmdEnv.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ module.exports = function getRunCmdEnv() {
1111
const nodeModulesBinDir = path.join(__dirname, '../../node_modules/.bin');
1212

1313
Object.entries(env)
14-
.filter(
15-
v =>
16-
v
17-
.slice(0, 1)
18-
.pop()
19-
.toLowerCase() === 'path',
20-
)
14+
.filter(v => v.slice(0, 1).pop().toLowerCase() === 'path')
2115
.forEach(v => {
2216
const key = v.slice(0, 1).pop();
2317
env[key] = env[key] ? `${nodeModulesBinDir}:${env[key]}` : nodeModulesBinDir;

antd-tools/utils/projectHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function injectRequire() {
2020
const Module = require('module');
2121

2222
const oriRequire = Module.prototype.require;
23-
Module.prototype.require = function(...args) {
23+
Module.prototype.require = function (...args) {
2424
const moduleName = args[0];
2525
try {
2626
return oriRequire.apply(this, args);

components/_util/component-classes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,6 @@ export class ClassList {
163163
* @return {ClassList}
164164
* @api public
165165
*/
166-
export default function(el: Element): ClassList {
166+
export default function (el: Element): ClassList {
167167
return new ClassList(el);
168168
}

components/_util/copy-to-clipboard/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function copy(text: string, options?: Options): boolean {
5252
mark.style.MozUserSelect = 'text';
5353
mark.style.msUserSelect = 'text';
5454
mark.style.userSelect = 'text';
55-
mark.addEventListener('copy', function(e) {
55+
mark.addEventListener('copy', function (e) {
5656
e.stopPropagation();
5757
if (options.format) {
5858
e.preventDefault();

0 commit comments

Comments
 (0)