mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Use built-in no-restricted-syntax to ban null instead of plugin, ban null type too (#58095)
This commit is contained in:
@@ -64,7 +64,7 @@ function main() {
|
||||
writeFileSync(tsFilePath, modifiedTsFileContents);
|
||||
}
|
||||
|
||||
/* eslint-disable no-null/no-null */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
/**
|
||||
* @param {string} tsFilePath
|
||||
* @param {string} tsFileContents
|
||||
@@ -101,7 +101,7 @@ function parsePackageJsonVersion(versionString) {
|
||||
assert(match !== null, "package.json 'version' should match " + versionRgx.toString());
|
||||
return { majorMinor: match[1], patch: match[2] };
|
||||
}
|
||||
/* eslint-enable no-null/no-null */
|
||||
/* eslint-enable no-restricted-syntax */
|
||||
|
||||
/**
|
||||
* e.g. 0-dev.20170707
|
||||
|
||||
@@ -53,7 +53,7 @@ module.exports = createRule({
|
||||
}
|
||||
|
||||
if (node.type === AST_NODE_TYPES.Literal) {
|
||||
// eslint-disable-next-line no-null/no-null
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
return node.value === null || node.value === true || node.value === false;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ module.exports = createRule({
|
||||
return;
|
||||
}
|
||||
|
||||
if ((allowNamedFunctions && node.id !== null) || isMethodType(node)) { // eslint-disable-line no-null/no-null
|
||||
if ((allowNamedFunctions && node.id !== null) || isMethodType(node)) { // eslint-disable-line no-restricted-syntax
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user