svelte-check
Advanced tools
Comparing version 1.0.23 to 1.0.24
@@ -86,2 +86,31 @@ "use strict"; | ||
} | ||
function instantiateWriter(myArgs) { | ||
const outputFormat = outputFormats.includes(myArgs['output']) | ||
? myArgs['output'] | ||
: 'human-verbose'; | ||
if (outputFormat === 'human-verbose' || outputFormat === 'human') { | ||
return new writers_1.HumanFriendlyWriter(process.stdout, outputFormat === 'human-verbose'); | ||
} | ||
else { | ||
return new writers_1.MachineFriendlyWriter(process.stdout); | ||
} | ||
} | ||
function getOptions(myArgs) { | ||
return { | ||
compilerWarnings: stringToObj(myArgs['compiler-warnings']), | ||
}; | ||
function stringToObj(str = '') { | ||
return str | ||
.split(',') | ||
.map((s) => s.trim()) | ||
.filter((s) => !!s) | ||
.reduce((settings, setting) => { | ||
const [name, val] = setting.split(':'); | ||
if (val === 'error' || val === 'ignore') { | ||
settings[name] = val; | ||
} | ||
return settings; | ||
}, {}); | ||
} | ||
} | ||
(async () => { | ||
@@ -101,13 +130,4 @@ var _a; | ||
} | ||
const outputFormat = outputFormats.includes(myArgs['output']) | ||
? myArgs['output'] | ||
: 'human-verbose'; | ||
let writer; | ||
if (outputFormat === 'human-verbose' || outputFormat === 'human') { | ||
writer = new writers_1.HumanFriendlyWriter(process.stdout, outputFormat === 'human-verbose'); | ||
} | ||
else { | ||
writer = new writers_1.MachineFriendlyWriter(process.stdout); | ||
} | ||
const svelteCheck = new svelte_language_server_1.SvelteCheck(workspaceUri.fsPath); | ||
const writer = instantiateWriter(myArgs); | ||
const svelteCheck = new svelte_language_server_1.SvelteCheck(workspaceUri.fsPath, getOptions(myArgs)); | ||
const filePathsToIgnore = ((_a = myArgs['ignore']) === null || _a === void 0 ? void 0 : _a.split(',')) || []; | ||
@@ -114,0 +134,0 @@ if (myArgs['watch']) { |
{ | ||
"name": "svelte-check", | ||
"description": "Svelte Code Checker Terminal Interface", | ||
"version": "1.0.23", | ||
"version": "1.0.24", | ||
"main": "./dist/src/index.js", | ||
@@ -6,0 +6,0 @@ "bin": "./bin/svelte-check", |
@@ -63,2 +63,4 @@ # Check your code with svelte-check | ||
`--compiler-warnings <code1:error|ignore,code2:error|ignore>` A list of Svelte compiler warning codes. Each entry defines whether that warning should be ignored or treated as an error. Warnings are comma-separated, between warning code and error level is a colon; all inside quotes. Example: --compiler-warnings "css-unused-selector:ignore,unused-export-let:error" | ||
### More docs, preprocessor setup and troubleshooting | ||
@@ -65,0 +67,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
230271
309
118