Use built-in no-restricted-syntax to ban null instead of plugin, ban null type too (#58095)

This commit is contained in:
Jake Bailey
2024-04-18 09:06:32 -07:00
committed by GitHub
parent 72f413cea0
commit 17e420daf6
45 changed files with 128 additions and 139 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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;
}