Skip to content

Commit ffb2a59

Browse files
committed
style: lint add semi and prettier
1 parent b4d9bfd commit ffb2a59

File tree

1,264 files changed

+38272
-36576
lines changed

Some content is hidden

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

1,264 files changed

+38272
-36576
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ node_modules/
33
**/style/
44
*.html
55
/components/test/*
6+
es/
7+
lib/
8+
site-dist/
9+
dist/

.eslintrc

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"es6": true
88
},
99
"parser": "babel-eslint",
10-
"extends": ["plugin:vue-libs/recommended"],
10+
"extends": ["plugin:vue-libs/recommended", "prettier"],
1111
"rules": {
1212
"comma-dangle": [2, "always-multiline"],
1313
"no-var": "error",
1414
"no-unused-vars": "warn",
1515
"camelcase": "off",
16-
"no-extra-boolean-cast": "off"
16+
"no-extra-boolean-cast": "off",
17+
"semi": ["error", "always"]
1718
}
18-
}
19+
}

.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**/*.md
2+
**/*.svg
3+
**/*.ejs
4+
**/*.html
5+
package.json
6+
es/**
7+
lib/**
8+
site-dist/**
9+
dist/**

.prettierrc

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 100,
5+
"overrides": [
6+
{
7+
"files": ".prettierrc",
8+
"options": {
9+
"parser": "json"
10+
}
11+
},
12+
{
13+
"files": ".stylelintrc",
14+
"options": {
15+
"parser": "json"
16+
}
17+
}
18+
]
19+
}

.stylelintrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"extends": "stylelint-config-standard",
3-
"ignoreFiles": "./components/**",
2+
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
43
"rules": {
54
"comment-empty-line-before": null,
65
"declaration-empty-line-before": null,

antd-tools/cli/index.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
#!/usr/bin/env node
22

3-
'use strict'
3+
'use strict';
44

5-
require('colorful').colorful()
5+
require('colorful').colorful();
66

7-
const program = require('commander')
8-
const packageInfo = require('../../package.json')
7+
const program = require('commander');
8+
const packageInfo = require('../../package.json');
99

1010
program
1111
.version(packageInfo.version)
1212
.command('run [name]', 'run specified task')
13-
.parse(process.argv)
13+
.parse(process.argv);
1414

1515
// https://github.com/tj/commander.js/pull/260
16-
const proc = program.runningCommand
16+
const proc = program.runningCommand;
1717
if (proc) {
18-
proc.on('close', process.exit.bind(process))
18+
proc.on('close', process.exit.bind(process));
1919
proc.on('error', () => {
20-
process.exit(1)
21-
})
20+
process.exit(1);
21+
});
2222
}
2323

24-
const subCmd = program.args[0]
24+
const subCmd = program.args[0];
2525
if (!subCmd || subCmd !== 'run') {
26-
program.help()
26+
program.help();
2727
}

antd-tools/cli/run.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
#!/usr/bin/env node
22

3-
'use strict'
3+
'use strict';
44

5-
require('colorful').colorful()
6-
const gulp = require('gulp')
7-
const program = require('commander')
5+
require('colorful').colorful();
6+
const gulp = require('gulp');
7+
const program = require('commander');
88

99
program.on('--help', () => {
10-
console.log(' Usage:'.to.bold.blue.color)
11-
console.log()
12-
})
10+
console.log(' Usage:'.to.bold.blue.color);
11+
console.log();
12+
});
1313

14-
program.parse(process.argv)
14+
program.parse(process.argv);
1515

16-
const task = program.args[0]
16+
const task = program.args[0];
1717

1818
if (!task) {
19-
program.help()
19+
program.help();
2020
} else {
21-
console.log('antd-tools run', task)
21+
console.log('antd-tools run', task);
2222

23-
require('../gulpfile')
23+
require('../gulpfile');
2424

25-
gulp.start(task)
25+
gulp.start(task);
2626
}

antd-tools/getBabelCommonConfig.js

+26-20
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
1-
'use strict'
1+
'use strict';
22

3-
module.exports = function (modules) {
3+
module.exports = function(modules) {
44
const plugins = [
55
require.resolve('babel-plugin-transform-vue-jsx'),
66
require.resolve('babel-plugin-transform-es3-member-expression-literals'),
77
require.resolve('babel-plugin-transform-es3-property-literals'),
88
require.resolve('babel-plugin-transform-object-assign'),
99
require.resolve('babel-plugin-transform-object-rest-spread'),
1010
require.resolve('babel-plugin-transform-class-properties'),
11-
]
12-
plugins.push([require.resolve('babel-plugin-transform-runtime'), {
13-
polyfill: false,
14-
}])
11+
];
12+
plugins.push([
13+
require.resolve('babel-plugin-transform-runtime'),
14+
{
15+
polyfill: false,
16+
},
17+
]);
1518
return {
1619
presets: [
17-
[require.resolve('babel-preset-env'), {
18-
modules,
19-
targets: {
20-
browsers: [
21-
'last 2 versions',
22-
'Firefox ESR',
23-
'> 1%',
24-
'ie >= 9',
25-
'iOS >= 8',
26-
'Android >= 4',
27-
],
20+
[
21+
require.resolve('babel-preset-env'),
22+
{
23+
modules,
24+
targets: {
25+
browsers: [
26+
'last 2 versions',
27+
'Firefox ESR',
28+
'> 1%',
29+
'ie >= 9',
30+
'iOS >= 8',
31+
'Android >= 4',
32+
],
33+
},
2834
},
29-
}],
35+
],
3036
],
3137
plugins,
3238
env: {
3339
test: {
3440
plugins: [require.resolve('babel-plugin-istanbul')],
3541
},
3642
},
37-
}
38-
}
43+
};
44+
};

0 commit comments

Comments
 (0)