- Dropped support for TypeScript@<2.7.0. The new backwards compatibility policy ensures support for the last 3 stable minor releases of TypeScript.
prefer-number-isnan
->prefer-number-methods
which checksisFinite
in addition
Features:
- new rule:
no-octal-escape
- new rule:
type-assertion
- new rule:
delete-only-optional-property
- Added support for
resolveJsonModule
compilerOption - handle
unknown
type introduced in TypeScript@3.0.0 --fix
no longer autofixes files with syntax errors to prevent further destroying your code
Bugfixes:
- fixed crash in
no-inferred-empty-object
with TypeScript@3.0.0 and multiple JSDoc@template
tags no-useless-assertion
: better handling of contextual typesno-useless-predicate
: handle intersection typesprefer-for-of
: ensure iterated object implements iteration protocolprefer-for-of
: ensure iterator yields the same type as index signatureno-unstable-api-use
: check element access with well-known symbols
This release fixes a few bugs related to the release process:
- packages are released in dependency order: a new version of a package will not be published before it's dependency
- fixed SemVer version mismatch by publishing packages that depend on other published packages
Bugfixes:
no-nan-compare
: also detects comparing withNumber.NaN
Features:
- new rule:
parameter-properties
(contributed by @aervin) - new rule:
no-duplicate-spread-property
- new rule:
prefer-namespace-keyword
- new rule:
no-useless-declare
- new rule:
ban-dom-globals
bifrost
added a function to wrap Fimbullinter rules for the use in TSLint- many rules now have a detailed documentation page
- Node.js v10 is now officially supported
Bugfixes:
await-only-promise
now allowsfor-await-of
withIterable<PromiseLike<any>>
, previously it only allowedAsyncIterable<any>
no-duplicate-case
added check for unions of literal typesno-inferred-empty-object
handles generic functions declared in JSDocno-useless-assertion
fixed detection if variable may be used before being assigned and thus the non-null assertion is actually necessary
Features:
- new rule:
no-invalid-assertion
no-inferred-empty-object
checks JSX elements and tagged templates starting from typescript@2.9.0no-useless-initializer
checks destructuring defaults
Bugfixes:
no-inferred-empty-object
correctly checks classes with constructorno-inferred-empty-object
correctly checks classes from JavaScript files that have type parameters in JSDocno-useless-assertion
forbids definite assignment assertions on properties with computed nameno-return-await
wraps object literals returned from shorthand arrow functions in parentheses to avoid syntax errorsno-useless-spread
no longer autofixes object spread to avoid introducing duplicate key errors--project
flag no longer causes a crash when referencing non-existent filesvaltyr
correctly loads custom formatters
Thanks to @aervin for contributing.
Features:
- new rule:
no-unassigned-variable
- new rule:
no-useless-spread
(contributed by @aervin) - new rule:
return-never-call
Bugfixes:
no-inferred-empty-object
: check generic JSX elements (starting from typescript@2.9)no-useless-assertion
: correctly handle conditional typesno-useless-predicate
: checks comparingtypeof
with a variable that has a literal type:const str = 'string'; typeof 1 === str;
Features:
- new rule:
new-parens
- new rule:
no-case-declaration
- new rule:
no-duplicate-case
- new rule:
no-misused-generics
- new rule:
no-useless-jump-label
- new rule:
prefer-for-of
- optimized some of the existing rules for performance
- added decorators to
ymir
for commonly used rule predicates:@excludeDeclarationFiles
and@typescriptOnly
Bugfixes:
- Errors in
tsconfig.json
are now reported as warnings instead of errors. That allows the use of older versions of TypeScript while using compiler options introduced in a later version. no-useless-predicate
now also checkscase
clauses ofswitch
statements
Features:
- new rule
prefer-const
- new rule
no-useless-predicate
Bugfixes:
- fixed dependency versions of nightly releases for packages that were published in a previous nightly release
- changes to tests and project setup no longer cause a package to be released
This release contains a lot of refactoring and structural changes:
- renamed
await-promise
toawait-only-promise
- renamed
deprecation
tono-unstable-api-use
Two new packages were split from the wotan
package:
ymir
contains all base types and classes. This package can be used by extension and rule authors to not depend on the fullwotan
runtime.mimir
contains all rules, formatters and configuration presets. Together withymir
this package allows rules to be executed in a different runtime without depending on the wholewotan
package
Features:
- Added recipes to Readme
- new rule
await-async-result
- new rule
generator-require-yield
- new rule
no-nan-compare
- new rule
no-unreachable-code
- new rule
prefer-dot-notation
- new rule
prefer-number-isnan
- new rule
prefer-object-spread
no-unstable-api-use
(previouslydeprecation
) also checks@experimental
tag
Bugfixes:
no-unused-label
no longer forbids labels on statements other than loops and switch
Features:
valtyr
added support for processors via .fimbullinter.yaml
Features:
- Added some documentation on how to use the API
wotan
:- new rule
no-useless-initializer
- Renamed
--format
CLI argument to--formatter
- Added support for a configuration file with CLI defaults called
.fimbullinter.yaml
- Added
wotan save
subcommand to write or update.fimbullinter.yaml
- Some internal refactoring and breaking API changes for plugin modules
wotan show
subcommand added optional-c
option- Refactored failure filtering to allow custom services to filter by different criteria than line base comments with rule names.
- new rule
valtyr
:- Added new package
@fimbul/valtyr
to enable TSLint-like behavior - Uses
tslint.json
files for configuration - Uses TSLint rules and formatters
- Filters by
//tslint:disable
comments - Cannot be used together with
.wotanrc.yaml
or Wotan rules and formatters - The next release will include support for processors by using the new
.fimbullinter.yaml
file
- Added new package
bifrost
:- Enforce that rules add failures for the current SourceFile only
wrapTslintRule
:name
parameter is now optional
Bugfixes:
wotan
:- Really "Include missing declarations in bundled declaration files" which was documented as part of v0.1.0
- Fixed logic to find and report unmatched files in processed projects
- Fixed crash during directory scanning when using
--project
if a directory contains an invalid.wotanrc.yaml
file
Features:
- Enabled nightly builds for all packages. These can be installed with
yarn add @fimbul/wotan@next @fimbul/ve@next ...
(ornpm install
if you prefer). ve
: use SAX parser for performance and avoid false positive matches of<script>
tagswotan
:- New rule
typecheck
: type errors as lint rule failures (similar totslint --type-check
, but is correctly formatted and can be ignored like any other rule) - New rule
syntaxcheck
: syntax errors as lint rule failures - New rule
no-inferred-empty-object
: warns about uninferred type parameters that might cause unintended behavior - Introduced
LineSwitchParser
to allow overriding the default line switch handling - Introduced
ConfigurationProvider
to allow overriding the default config lookup and parsing - Removed implicit configuration lookup in home directory
- Improved error reporting for errors in configuration files
- Fail early for circular aliases or missing rulesDirectories in configuration files
- Allow alias shorthands:
overrides: prefix: name: some-rule-name # same as `name: { rule: some-rule-name }`
- New rule
- Added documentation for rule and package authors
Bugfixes:
- Include missing declarations in bundled declaration files
wotan
:- Rule
no-useless-type-assertion
now correctly handles class expressions and qualified type names - Detect MPEG TS files and show a warning. Such files are treated as if they were empty.
stylish
formatter correctly displaysline:col
information for files with BOM
- Rule
Packages:
@fimbul/wotan
: The main linter runtime with a set of core rules and formatters- Available formatters:
json
andstylish
(default) - Available rules:
await-promise
warns about unnecessary await on non-Promise valuesdeprecation
detects the use of deprecated APIsno-debugger
bansdebugger;
statementsno-fallthrough
warns about unintentional fallthrough in switch casesno-return-await
warns about unnecessaryreturn await foo;
where you can justreturn foo;
no-unsafe-finally
warns about control flow statements within thefinally
blockno-unused-expression
warns about expressions without side-effects whose result is not usedno-unused-label
does what the name suggests, reallyno-useless-assertion
detects assertions that don't change the type of the expressiontrailing-newline
enforces a line break on the last line of a filetry-catch-return-await
enforces the use ofreturn await foo;
inside try-catch blocks
- Available formatters:
@fimbul/ve
: The official processor plugin for Vue Single File Components@fimbul/heimdall
: Plugin to enable the use of TSLint rules and formatters within Wotan@fimbul/bifrost
: Allows authors of TSLint rules and formatters to make them available for Wotan without refactoring.