Merge pull request #4570 from thornbill/prefer-starts-ends-with
Add prefer string starts/ends with eslint rule
This commit is contained in:
@@ -253,7 +253,8 @@ module.exports = {
|
||||
'Windows': 'readonly'
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-floating-promises': ['warn']
|
||||
'@typescript-eslint/no-floating-promises': ['warn'],
|
||||
'@typescript-eslint/prefer-string-starts-ends-with': ['error']
|
||||
}
|
||||
},
|
||||
// TypeScript source files
|
||||
|
||||
@@ -108,7 +108,7 @@ function getDateValue(form, element, property) {
|
||||
const parts = date.toISOString().split('T');
|
||||
|
||||
// If the date is the same, preserve the time
|
||||
if (parts[0].indexOf(val) === 0) {
|
||||
if (parts[0].startsWith(val)) {
|
||||
const iso = parts[1];
|
||||
|
||||
val += 'T' + iso;
|
||||
|
||||
Reference in New Issue
Block a user