mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add double quotes for localize hygiene check (#6492)
* Add localize single quote hygiene task * Update localize calls * Update comment * Fix build failures and remove test code
This commit is contained in:
@@ -195,6 +195,10 @@ const useStrictFilter = [
|
||||
'src/**'
|
||||
];
|
||||
|
||||
const sqlFilter = [
|
||||
'src/sql/**'
|
||||
];
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const copyrightHeaderLines = [
|
||||
'/*---------------------------------------------------------------------------------------------',
|
||||
@@ -284,6 +288,19 @@ function hygiene(some) {
|
||||
|
||||
this.emit('data', file);
|
||||
});
|
||||
|
||||
const localizeDoubleQuotes = es.through(function (file) {
|
||||
const lines = file.__lines;
|
||||
lines.forEach((line, i) => {
|
||||
if (/localize\(['"].*['"],\s'.*'\)/.test(line)) {
|
||||
console.error(file.relative + '(' + (i + 1) + ',1): Message parameter to localize calls should be double-quotes');
|
||||
errorCount++;
|
||||
}
|
||||
});
|
||||
|
||||
this.emit('data', file);
|
||||
});
|
||||
|
||||
// {{SQL CARBON EDIT}} END
|
||||
|
||||
const formatting = es.map(function (file, cb) {
|
||||
@@ -352,7 +369,10 @@ function hygiene(some) {
|
||||
.pipe(tsl)
|
||||
// {{SQL CARBON EDIT}}
|
||||
.pipe(filter(useStrictFilter))
|
||||
.pipe(useStrict);
|
||||
.pipe(useStrict)
|
||||
// Only look at files under the sql folder since we don't want to cause conflicts with VS code
|
||||
.pipe(filter(sqlFilter))
|
||||
.pipe(localizeDoubleQuotes);
|
||||
|
||||
const javascript = result
|
||||
.pipe(filter(eslintFilter))
|
||||
|
||||
Reference in New Issue
Block a user