Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 29323cd

Browse files
committed
fix "no-shadow"
1 parent 3115095 commit 29323cd

File tree

31 files changed

+100
-105
lines changed

31 files changed

+100
-105
lines changed

build/gulp/plugins/gulp-component-menu-behaviors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ type BehaviorMenuItem = {
2020
}
2121

2222
const getTextFromCommentToken = (commentTokens, tokenTitle): string => {
23-
const token = commentTokens.find(token => token.title === tokenTitle)
24-
return token ? token.description : ''
23+
const resultToken = commentTokens.find(token => token.title === tokenTitle)
24+
return resultToken ? resultToken.description : ''
2525
}
2626

2727
export default () => {

build/gulp/tasks/docs.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ const { paths } = config
2525
const g = require('gulp-load-plugins')()
2626
const { colors, log } = g.util
2727

28-
const handleWatchChange = path => log(`File ${path} was changed, running tasks...`)
29-
const handleWatchUnlink = (group, path) => {
30-
log(`File ${path} was deleted, running tasks...`)
31-
remember.forget(group, path)
28+
const handleWatchChange = changedPath => log(`File ${changedPath} was changed, running tasks...`)
29+
const handleWatchUnlink = (group, changedPath) => {
30+
log(`File ${changedPath} was deleted, running tasks...`)
31+
remember.forget(group, changedPath)
3232
}
3333

3434
// ----------------------------------------
@@ -224,7 +224,7 @@ task('watch:docs', cb => {
224224
// rebuild example menus
225225
watch(examplesIndexSrc, series('build:docs:example-menu'))
226226
.on('change', handleWatchChange)
227-
.on('unlink', path => handleWatchUnlink('example-menu', path))
227+
.on('unlink', changedPath => handleWatchUnlink('example-menu', changedPath))
228228

229229
watch(examplesSrc, series('build:docs:example-sources'))
230230
.on('change', handleWatchChange)
@@ -241,7 +241,7 @@ task('watch:docs', cb => {
241241

242242
watch(behaviorSrc, series('build:docs:component-menu-behaviors'))
243243
.on('change', handleWatchChange)
244-
.on('unlink', path => handleWatchUnlink('component-menu-behaviors', path))
244+
.on('unlink', changedPath => handleWatchUnlink('component-menu-behaviors', changedPath))
245245

246246
// rebuild images
247247
watch(`${config.paths.docsSrc()}/**/*.{png,jpg,gif}`, series('build:docs:images')).on(

build/gulp/tasks/perf.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ const normalizeMeasures = (measures: ProfilerMeasureCycle[]): NormalizedMeasures
7272
{},
7373
)
7474

75-
return _.mapValues(perExampleMeasures, (measures: ProfilerMeasure[]) => ({
76-
actualTime: reduceMeasures(measures, 'actualTime'),
77-
baseTime: reduceMeasures(measures, 'baseTime'),
75+
return _.mapValues(perExampleMeasures, (profilerMeasures: ProfilerMeasure[]) => ({
76+
actualTime: reduceMeasures(profilerMeasures, 'actualTime'),
77+
baseTime: reduceMeasures(profilerMeasures, 'baseTime'),
7878
}))
7979
}
8080

@@ -139,7 +139,7 @@ task('perf:build', cb => {
139139
task('perf:run', async () => {
140140
const measures: ProfilerMeasureCycle[] = []
141141
const times = (argv.times as string) || DEFAULT_RUN_TIMES
142-
const filter = argv.filter
142+
const pathFilter = argv.filter
143143

144144
const bar = process.env.CI
145145
? { tick: _.noop }
@@ -159,7 +159,7 @@ task('perf:run', async () => {
159159
const page = await browser.newPage()
160160
await page.goto(`http://${config.server_host}:${config.perf_port}`)
161161

162-
const measuresFromStep = await page.evaluate(filter => window.runMeasures(filter), filter)
162+
const measuresFromStep = await page.evaluate(filter => window.runMeasures(filter), pathFilter)
163163
measures.push(measuresFromStep)
164164
bar.tick()
165165

build/gulp/tasks/stats.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ const semverCmp = (a, b) => {
4646
return 0
4747
}
4848

49-
function webpackAsync(config): Promise<any> {
49+
function webpackAsync(webpackConfig): Promise<any> {
5050
return new Promise((resolve, reject) => {
51-
const compiler = webpack(config)
51+
const compiler = webpack(webpackConfig)
5252
compiler.run((err, stats) => {
5353
const statsJson = stats.toJson()
5454
const { errors, warnings } = statsJson
@@ -73,14 +73,14 @@ function webpackAsync(config): Promise<any> {
7373

7474
async function compileOneByOne(allConfigs) {
7575
let assets = []
76-
for (const config of allConfigs) {
77-
log('Compiling', config.output.filename)
76+
for (const webpackConfig of allConfigs) {
77+
log('Compiling', webpackConfig.output.filename)
7878
try {
79-
const result = await webpackAsync(config)
79+
const result = await webpackAsync(webpackConfig)
8080
assets = [...assets, ...result.assets]
8181
log('Done', result.assets[0].name) // All builds should produce just single asset
8282
} catch (err) {
83-
log('Error', config.output.filename)
83+
log('Error', webpackConfig.output.filename)
8484
throw err
8585
}
8686
}

build/gulp/tasks/test-projects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const log = (context: string) => (message: string) => {
2323
console.log('='.repeat(80))
2424
}
2525

26-
export const runIn = path => cmd => sh(`cd ${path} && ${cmd}`)
26+
export const runIn = targetPath => cmd => sh(`cd ${targetPath} && ${cmd}`)
2727

2828
const addResolutionPathsForStardustPackages = async (
2929
testProjectDir: string,

build/gulp/tasks/test-vulns.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ const SCAN_RESULTS_DIR_PATH = paths.base(SCAN_RESULTS_DIR_NAME)
1414
const log = message => debug.log(message)
1515
log.success = message => debug.log(`✔ ${message}`)
1616

17-
const ensureDirExists = path => {
18-
if (!fs.existsSync(path)) {
19-
sh(`mkdir -p ${path}`)
17+
const ensureDirExists = directoryPath => {
18+
if (!fs.existsSync(directoryPath)) {
19+
sh(`mkdir -p ${directoryPath}`)
2020
}
2121
}
2222

config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ const paths = {
3636
dll: base.bind(null, envConfig.dir_dll),
3737
docsDist: base.bind(null, envConfig.dir_docs_dist),
3838
docsSrc: base.bind(null, envConfig.dir_docs_src),
39-
packageDist: (packageName: string, ...paths: string[]) =>
40-
base(envConfig.dir_packages, packageName, 'dist', ...paths),
41-
packageSrc: (packageName: string, ...paths: string[]) =>
42-
base(envConfig.dir_packages, packageName, 'src', ...paths),
39+
packageDist: (packageName: string, ...passedPaths: string[]) =>
40+
base(envConfig.dir_packages, packageName, 'dist', ...passedPaths),
41+
packageSrc: (packageName: string, ...passedPaths: string[]) =>
42+
base(envConfig.dir_packages, packageName, 'src', ...passedPaths),
4343
packages: base.bind(null, envConfig.dir_packages),
4444
perfDist: base.bind(null, envConfig.dir_perf_dist),
4545
perfSrc: base.bind(null, envConfig.dir_perf_src),

docs/src/components/ComponentDoc/ComponentControls/ComponentControlsCodeSandbox/ComponentControlsCodeSandbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ class ComponentControlsShowCode extends React.Component<
8686
skipRedirect
8787
template={template}
8888
>
89-
{({ isLoading, isDeploying, active }) => {
89+
{({ isLoading, isDeploying, active: isActive }) => {
9090
const loading = isLoading || isDeploying
9191
return (
9292
<LabelledButton
9393
iconName={loading ? 'spinner' : 'connectdevelop'}
9494
label={loading ? 'Exporting...' : 'CodeSandbox'}
95-
active={active}
95+
active={isActive}
9696
/>
9797
)
9898
}}

docs/src/components/ComponentDoc/PerfChart/PerfDataProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const PerfDataProvider: React.FC = ({ children }) => {
2727
setData(responseJson)
2828
setLoading(false)
2929
})
30-
.catch(error => {
31-
setError(error)
30+
.catch(e => {
31+
setError(e)
3232
setLoading(false)
3333
})
3434
}

docs/src/components/ComponentPlayground.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ type ComponentPlaygroundProps = {
1313
}
1414

1515
const ComponentPlayground: React.FunctionComponent<ComponentPlaygroundProps> = props => {
16-
const playgroundPath = _.find(playgroundPaths, playgroundPath =>
16+
const resultPath = _.find(playgroundPaths, playgroundPath =>
1717
_.includes(playgroundPath, `/${props.componentName}/`),
1818
)
1919

20-
if (playgroundPath) {
21-
const PlaygroundComponent: React.FunctionComponent = examplePlaygroundContext(playgroundPath)
20+
if (resultPath) {
21+
const PlaygroundComponent: React.FunctionComponent = examplePlaygroundContext(resultPath)
2222
.default
2323

2424
return (

0 commit comments

Comments
 (0)