Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
c35dc9a0
Unverified
Commit
c35dc9a0
authored
Feb 18, 2020
by
Steven Vachon
Committed by
GitHub
Feb 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
@grafana/toolkit: lint fix option now writes changes to disk (#22278)
parent
e08b39d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
packages/grafana-toolkit/src/cli/tasks/plugin.build.ts
+10
-4
No files found.
packages/grafana-toolkit/src/cli/tasks/plugin.build.ts
View file @
c35dc9a0
...
...
@@ -10,7 +10,7 @@ import { constants as fsConstants, promises as fs } from 'fs';
import
{
CLIEngine
}
from
'eslint'
;
import
{
bundlePlugin
as
bundleFn
,
PluginBundleOptions
}
from
'./plugin/bundle'
;
const
{
copyFile
}
=
fs
;
const
{
access
,
copyFile
}
=
fs
;
const
{
COPYFILE_EXCL
}
=
fsConstants
;
const
rimraf
=
promisify
(
rimrafCallback
);
...
...
@@ -62,10 +62,10 @@ const getTypescriptSources = () => globby(resolvePath(process.cwd(), 'src/**/*.+
// @ts-ignore
const
getStylesSources
=
()
=>
globby
(
resolvePath
(
process
.
cwd
(),
'src/**/*.+(scss|css)'
));
export
const
lintPlugin
=
useSpinner
<
Fixable
>
(
'Linting'
,
async
({
fix
})
=>
{
export
const
lintPlugin
=
useSpinner
<
Fixable
>
(
'Linting'
,
async
({
fix
}
=
{}
)
=>
{
try
{
// Show a warning if the tslint file exists
await
fs
.
access
(
resolvePath
(
process
.
cwd
(),
'tslint.json'
));
await
access
(
resolvePath
(
process
.
cwd
(),
'tslint.json'
));
console
.
log
(
'
\
n'
);
console
.
log
(
'--------------------------------------------------------------'
);
console
.
log
(
'NOTE: @grafana/toolkit has migrated to use eslint'
);
...
...
@@ -91,7 +91,13 @@ export const lintPlugin = useSpinner<Fixable>('Linting', async ({ fix }) => {
fix
,
});
const
{
errorCount
,
results
,
warningCount
}
=
cli
.
executeOnFiles
(
await
getTypescriptSources
());
const
report
=
cli
.
executeOnFiles
(
await
getTypescriptSources
());
if
(
fix
)
{
CLIEngine
.
outputFixes
(
report
);
}
const
{
errorCount
,
results
,
warningCount
}
=
report
;
if
(
errorCount
>
0
||
warningCount
>
0
)
{
const
formatter
=
cli
.
getFormatter
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment