feat(basic): ban some deprecated global functions (#190)
This commit is contained in:
parent
e787e9a647
commit
aefa76e48a
@ -259,7 +259,23 @@ module.exports = {
|
||||
asyncArrow: 'always',
|
||||
},
|
||||
],
|
||||
'no-restricted-globals': ['error', { name: 'global', message: 'Use `globalThis` instead.' }],
|
||||
'no-restricted-globals': [
|
||||
'error',
|
||||
{ name: 'global', message: 'Use `globalThis` instead.' },
|
||||
{ name: 'self', message: 'Use `globalThis` instead.' },
|
||||
{ name: 'window', message: 'Use `globalThis` instead.' },
|
||||
{ name: 'isNaN', message: 'Use `Number.isNaN` instead' },
|
||||
{ name: 'isFinite', message: 'Use `Number.isFinite` instead' },
|
||||
{ name: 'parseFloat', message: 'Use `Number.parseFloat` instead' },
|
||||
{ name: 'parseInt', message: 'Use `Number.parseInt` instead' },
|
||||
],
|
||||
'no-restricted-properties': [
|
||||
'error',
|
||||
{ object: 'globalThis', property: 'isNaN', message: 'Use `Number.isNaN` instead' },
|
||||
{ object: 'globalThis', property: 'isFinite', message: 'Use `Number.isFinite` instead' },
|
||||
{ object: 'globalThis', property: 'parseFloat', message: 'Use `Number.parseFloat` instead' },
|
||||
{ object: 'globalThis', property: 'parseInt', message: 'Use `Number.parseInt` instead' },
|
||||
],
|
||||
|
||||
// es6
|
||||
'no-var': 'error',
|
||||
|
Loading…
Reference in New Issue
Block a user