You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ban too-deep parent import. Ban self folder file import via parent path. Importing file from parent folder is reasonable in some case. But Importing file from grandparent folder should be blocked. See no-relative-parent-imports.
Ban import xxx from './node_modules/xxx'.
Ban importing files ends with .d.ts, .d.js, .d.
Prevent to call require or import function and pass a variable. It should pass literal.
Ban code like +somevar for converting some var to numebr type. We should use Number(somevar) only.
'@typescript-eslint/no-explicit-any': 'error'
'@typescript-eslint/no-non-null-assertion': 'error'
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }]
(should allowas unknown
)types
filed ofexports
inpackage.json
.camlecase
and enable@typescript-eslint/naming-convention
for ts file.dependencies
in the root package.json.export =
,import = require()
and commonjs (require
andmodule.exports
) in ts file. feat(ts): ban cjs exports in ts file antfu/eslint-config#167++
and--
. feat: enableno-plusplus
antfu/eslint-config#182parseInt
andparseFloat
function. feat(basic): ban some deprecated global functions antfu/eslint-config#190xxx.__proto__
, useObject.getPrototype(xxx)
instead.if
andfor
.*.d.ts
file. feat: no declare in ts file antfu/eslint-config#217const enum
. check https://www.typescriptlang.org/docs/handbook/enums.html#const-enum-pitfallsimport xxx from './node_modules/xxx'
..d.ts
,.d.js
,.d
.require
orimport
function and pass a variable. It should pass literal.+somevar
for converting some var to numebr type. We should useNumber(somevar)
only.import/no-relative-packages
.When defining a function, we should add a space between the function name and the left bracket. Because it convenient for searching function usage excluding the function definition.Adding a space after function name is better antfu/eslint-config#168banpublic
andprivate
descriptor.(protected
is useful in ts. And tc39 has no plan of implementingprotected
keyword.)The text was updated successfully, but these errors were encountered: