Skip to content

Commit b1ae997

Browse files
committed
style: format scripts
1 parent 547a55b commit b1ae997

File tree

21 files changed

+32
-353
lines changed

21 files changed

+32
-353
lines changed

antd-tools/generator-types/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ try {
1313
outputDir: path.resolve(rootPath, './vetur'),
1414
tagPrefix: 'a-',
1515
});
16+
// eslint-disable-next-line no-console
1617
console.log('generator types success');
1718
} catch (e) {
1819
console.error('generator types error', e);

antd-tools/generator-types/src/formatter.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/* eslint-disable no-continue */
2-
import { Artical, Articals } from './parser';
1+
import type { Articals } from './parser';
32
import { formatType, removeVersion, toKebabCase } from './utils';
4-
import { VueTag } from './type';
3+
import type { VueTag } from './type';
54

65
function getComponentName(name: string, tagPrefix: string) {
76
if (name) {
@@ -35,7 +34,7 @@ function parserProps(tag: VueTag, line: any) {
3534
});
3635
}
3736

38-
export function formatter(articals: Articals, componentName: string, tagPrefix: string = '') {
37+
export function formatter(articals: Articals, componentName: string, tagPrefix = '') {
3938
if (!articals.length) {
4039
return;
4140
}

antd-tools/generator-types/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import glob from 'fast-glob';
2-
import { join, dirname, basename } from 'path';
2+
import { join, dirname } from 'path';
33
import { mdParser } from './parser';
44
import { formatter } from './formatter';
55
import { genWebTypes } from './web-types';
66
import { readFileSync, outputFileSync } from 'fs-extra';
7-
import { Options, VueTag } from './type';
7+
import type { Options, VueTag } from './type';
88
import { normalizePath, getComponentName } from './utils';
99
import { genVeturTags, genVeturAttributes } from './vetur';
1010

antd-tools/generator-types/src/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PathLike } from 'fs';
1+
import type { PathLike } from 'fs';
22

33
export type VueSlot = {
44
name: string;

antd-tools/generator-types/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function formatType(type: string) {
1818
}
1919

2020
export function getComponentName(name: string) {
21-
let title = name
21+
const title = name
2222
.split('-')
2323
.map(it => it.substring(0, 1) + it.substring(1))
2424
.join('');

antd-tools/generator-types/src/vetur.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { VueTag, VeturTags, VeturAttributes } from './type';
1+
import type { VueTag, VeturTags, VeturAttributes } from './type';
22

33
export function genVeturTags(tags: VueTag[]) {
44
const veturTags: VeturTags = {};

antd-tools/generator-types/src/web-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { VueTag, Options } from './type';
1+
import type { VueTag, Options } from './type';
22

33
// create web-types.json to provide autocomplete in JetBrains IDEs
44
export function genWebTypes(tags: VueTag[], options: Options) {

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@
4242
"prettier": "prettier -c --write '**/*'",
4343
"pretty-quick": "pretty-quick",
4444
"dist": "node --max_old_space_size=8192 antd-tools/cli/run.js dist",
45-
"lint": "eslint -c ./.eslintrc.js --fix --ext .jsx,.js,.ts,.tsx ./components",
46-
"lint:demo": "eslint -c ./.eslintrc.js --fix --ext .vue ./components",
45+
"lint": "npm run tsc && npm run lint:demo && npm run lint:md && npm run lint:script && npm run lint:site",
46+
"lint:components": "eslint --fix --ext .jsx,.js,.ts,.tsx ./components",
47+
"lint:demo": "eslint --fix components/*/demo/*.vue",
48+
"lint:md": "eslint --fix *.md",
49+
"lint:script": "eslint . --ext '.js,.jsx,.ts,.tsx'",
4750
"lint:site": "eslint -c ./.eslintrc.js --fix --ext .jsx,.js,.ts,.tsx,vue ./site",
4851
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
4952
"codecov": "codecov",
50-
"routes": "node site/scripts/genrateRoutes.js"
53+
"routes": "node site/scripts/genrateRoutes.js",
54+
"tsc": "tsc --noEmit"
5155
},
5256
"repository": {
5357
"type": "git",

plugin/md/markdown/plugins/header.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { deeplyParseHeader } from '../../utils/parseHeader';
44
import { slugify } from './slugify';
55

66
export const extractHeaderPlugin = (md: MarkdownIt, include = ['h2', 'h3']) => {
7-
md.renderer.rules.heading_open = (tokens, i, options, env, self) => {
7+
md.renderer.rules.heading_open = (tokens, i, options, _env, self) => {
88
const token = tokens[i];
99
if (include.includes(token.tag)) {
1010
const title = tokens[i + 1].content;

plugin/md/markdown/plugins/highlightLines.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const highlightLinePlugin = (md: MarkdownIt) => {
2828
const rawCode = code.replace(wrapperRE, '');
2929
const highlightLinesCode = rawCode
3030
.split('\n')
31-
.map((split, index) => {
31+
.map((_split, index) => {
3232
const lineNumber = index + 1;
3333
const inRange = lineNumbers.some(([start, end]) => {
3434
if (start && end) {

0 commit comments

Comments
 (0)