Détail du package

@fimbul/mithotyn

fimbullinter379Apache-2.00.24.0

TypeScript LanguageService plugin for the Fimbullinter project

typescript, ts, lint, linter

readme

The Fimbullinter project

Pluggable TypeScript and JavaScript linter

Renovate enabled CircleCI Build status codecov Join the chat at https://gitter.im/fimbullinter/wotan

Available Packages

Wotan docs

The main linter runtime with a well-chosen set of builtin rules. Customizable with your own rules, processors, formatters, shareable configurations and plugin modules.

Please refer to the docs for a detailed explanation of available rules, configuration and usage.

docs

Official processor for Vue Single File Components (SFC). Extracts the script content from your *.vue files for linting.

Heimdall docs

Compatibility layer to allow the use of TSLint rules and formatters inside the Wotan runtime.

Valtýr docs

Make wotan behave almost like TSLint. Reuse your existing tslint.json without any change.

Bifröst docs

Allows authors of TSLint rules and formatters to provide their package for the use inside Wotan. Rules and formatters that use Bifröst don't need Heimdall to function correctly.

Ymir docs

Provides core types for custom rules and plugin authors.

Mímir docs

Contains all core rules, formatters and configuration presets.

Mithotyn docs

LanguageService Plugin for TypeScript. Provides real-time in-editor linting while you type.

Further Documentation

Recipes

What is this all about?

What's up with those names?

Norse mythology:

Fimbullinter comes from Fimbulwinter, the awful 3 years lasting winter that precedes the events of Ragnarök. 'fimbul' means 'the great', 'linter' is a tool that detects and warns about certain coding patterns.

Wotan is one of the many names of Odin, the All-Father. You may also know him by the name Woden, Wodan, Wensley, etc. Woden is a sacrificial god, bloodthirsty and cruel. He is constantly striving for wisdom. From his throne he can see everything in the nine worlds happening.

is the youngest of the three bothers Woden, Vili and Vé who together slew the giant Ymir and created the nine worlds from his body.

To the first human couple, Ask and Embla, Odin gave soul and life; Vili gave wit (intelligence) and sense of touch; and Vé gave countenance (appearance, facial expression), speech, hearing, and sight.

Heimdall (also known as Heimdallr), located where the burning rainbow bridge Bifröst meets heaven, keeps watch for the onset of Ragnarök.

Bifröst is the burning rainbow bridge that connects the world of humans with the realm of gods.

Valtýr, from "valr" (the dead, slain in battle) and "týr" (god), means God of the Slain and is often used to refer to Odin.

Ymir is the giant of whose body the whole world was created. He is the ancestor of all jötnar.

Mímir ("The rememberer, the wise one") renowned for his knowledge and wisdom. The god Odin carries around Mímir's head and it recites secret knowledge and counsel to him.

Mithotyn (actually "Mitoðinn", meaning "dispenser of fate") introduces rules where there were none. Fills Odin's place during his travels to foreign lands.

Why yet another linter?

This one tries to avoid design decisions of other linters that turned out to be problematic:

  • [x] Avoid name conflicts by prefixing rule names depending on the package they come from.
    • TSLint puts all rules in a global namespace and searches them in all available rules directories. The order of the directories matters while core rules override take precedence.
    • ESLint allows a local rules directory as CLI flag. Rules in that directory can override core rules.
  • [x] Dependencies of config files are resolved relative to that file.
    • TSLint already does that.
    • ESLint does not support that.
  • [x] No distinction between shareable configs and plugins. In fact both are just extendable configs that can optionally provide rules directories, settings, rules and processors.
    • TSLint allows you to choose between extends and rulesDirectory. The rules directory of a package is an implementation detail and should not be part of the user's config.
    • ESLint handles configs and plugins quite different. In fact they tried to deprecate shareable configs in favor of plugins.
  • [x] Lazy loading of rules to reduce startup time.
    • TSLint already does that.
    • ESLint expects plugins to provide the rules as already loaded objects. That causes a lot of overhead if you only use a few rules of a big package.
  • [x] Caching of file system access and configuration. As the Cache is a DI service, API users can clear the cache when needed.
  • [x] Support for processors from the beginning. Enabling linting of *.vue files and many more.
  • [x] Aliases for rules with configuration. Can be used to treat rules like ESLint's no-resticted-syntax as distinct named rules for each config option.
  • [x] The whole API is powered by a DI container. That makes it easy to inject a different service. You can even use plugins through the CLI to inject different services.
  • [x] "Global" configuration file (besides .wotanrc.yaml) for CLI defaults and plugin configuration: .fimbullinter.yaml. This file can be used by editor plugins as well, so there's no need to duplicate common configuration.
    • ESLint doesn't have such a file and declined to add one in the future. Tools like standard or xo wouldn't need to exist if you just needed to create such a config file with CLI defaults.
    • TSLint startet to stuff it into their tslint.json which leads to confused users.
  • [x] Report unused and redundant enable and disable comments (or parts thereof) with --report-useless-directives.
    • ESLint reports only unused disable comments. It only reports comments that are completely unused. Redundant comments are not reported as well as enable comments for non-existent rules.
    • TSLint does not support that.

Differences to TSLint

  • To extend a plugin or shareable config, use extends: plugin-name. The name will be resolved according to node's module resolution algorithm relative to the config file.
  • To use rules maintained inside your project, use rulesDirectory: {"my-prefix": "./path/to/rules"} and configure them as my-prefix/rule-one: "error". The rules directory is a path relative to the config file.
  • Overrides: You can override the main cofiguration by specifying one or more overrides. If the filename matches the glob pattern of the override, all settings provided by that override are applied. Overrides are processed in order, later overrides override settings from preceding overrides.
    • Patterns match relative to the configuration file they are specified in.
    • Patterns without a slash are only matched against the basename of each file.
    • To limit a match to the current directory, prefix the pattern with ./.
    • Negated patterns can be used to subtract from the matches of preceding patterns.
  • linterOptions.exclude -> exclude
    • Excludes are not overridden when extending a configuration.
    • Pattern matching follows the same rules as overrides (see above).
  • JSON5 support for config files.
  • Rule-independent settings that rules and processors can pick up.
  • Processors, even supports --project.
  • Aliases, see above
  • A sane and safe approach to fixing:
    • Doesn't fix files with syntax errors.
    • Excludes overlapping replacements to prevent destroying your code.
    • Runs a configurable number of iterations per file to apply conflicting changes in the next iteration.
    • Stops if fixes would introduce syntax errors.
    • Fixing with --project does not create the whole program from scratch, which makes it blazingly fast.
  • Testing
    • Tests are configured in JSON files that can configure everything you can specify though the CLI
    • Test files don't contain error markup. That avoids syntax errors and makes them easier to maintain. Lint results and fixed content are stored in separate baseline files.
    • The same code can be tested with different settings.
  • Supports TypeScript project references.
  • Loads default values for CLI options from .fimbullinter.yaml.
  • Doesn't use type information in unchecked JavaScript files (// @ts-nocheck or "checkJs": false).
  • Reports unused and redundant enable and disable comments with --report-useless-directives.

Supported Environments

This project runs on all actively supported versions of Node.js.

This project officially supports the latest 3 stable version of TypeScript. As of writing this is 3.0 - 3.2. It should work with TypeScript's nightly builds (typescript@next), but there is no guarantee.

Custom rules should at least use ES6 to have support for native classes. Otherwise you run into problems when trying to extend classes exported from any of the packages.

Semantic Versioning (SemVer policy)

:warning: The following policy does only apply for the yet to come 1.x and following releases. Every release in the 0.x range is considered experimental. There can and will be breaking API changes without deprecation.

In theory every change to a rule can break users and could be considered a breaking change. To avoid releasing a new major version for every bug fix, we have slightly different guidelines as outlined below.

Prereleases (nightly builds)

  • are not guaranteed to be stable
  • tagged as next on npm so you can install @fimbul/wotan@next
  • contains the latest changes intended for the next release
    • x.0.0-dev* contains all changes including breaking ones for the next major version
    • x.y.0-dev* contains all changes for the next minor version
    • there are no prereleases for patch versions

Patch Releases

  • fixes crashes
  • fixes regressions
  • refactorings of internal functionality that don't change user facing behavior

Minor Releases

  • adds new rules, rule options, formatters, processors, APIs
  • rules can add new checks that may lead to new findings
  • new rules and options are enabled in wotan:latest
  • rules can change their finding messages
  • formatters intended for human consumtion (e.g. stylish) can change their output
  • rules, rule options, formatters, processors and APIs can be deprecated
  • new configuration options can be added to configuration files

Major Releases

  • contains breaking API changes
  • removes previously deprecated rules, options, formatters, etc.
  • formatters intended for machine consumption (e.g. json or tap) can change their output
  • wotan:recommended is updated to the content of wotan:latest

Release Schedule

Currently there is no fixed release schedule. Nightly builds are published every night if there are changes on master. Patch releases are published as soon as bugs are identified and fixed. Minor releases are published every week or two if there are changes on master. Major releases are published once enough breaking changes have piled up.

License

Apache-2.0 © Klaus Meinhardt

changelog

Change Log

v0.24.0

:tada: This release contains two major features: caching and code fixes in the LanguageService plugin.

:warning: Breaking Changes:

The changes in the LanguageService plugin require that you update the @fimbul/mithotyn dependency and the fimbullinter.vscode-plugin VSCode plugin if you were using one of them.

Features:

  • new rule: no-object-spread-of-iterable warns about spreading an array into an object
  • new rule: no-implicit-tostring warns about implicit string coercion of certain types
  • new CLI option: --cache enables caching for fast incremental linting. Read more about caching
  • the LanguageService plugin uses caching to speed up linting in your editor
  • the LanguageService plugin now provides fixes for fixable findings

v0.23.0

:warning: Breaking Changes:

  • prefer-dot-notation now requires type information

Features:

  • prefer-dot-notation no longer reports findings which would cause a compile error when fixed
  • new rule: no-writeonly-property-read
  • Added support for new language features in all rules:
    • optional chaining
    • nullish coalescing
    • private identifiers
    • control-flow effects of never-returning functions
      • no-fallthrough and no-unreachable-code report better findings if type inforamtion is available
      • return-never-call only reports calls that TypeScript's control-flow-analysis cannot detect
    • template literal types
  • no-restricted-property-access
    • allow accessing all members via static super
    • allow accessing accessors via super
    • allow accessing abstract accessors via this in constructor
    • disallow read access to uninitialized properties in another property's initializer

Bugfixes:

  • Exclude JSON files and declartions emitted from .js(x) files in composite projects
  • async-function-assignability fixed false-positive on static class members
  • no-restricted-property-access
    • treat MethodSignature like MethodDeclaration
    • fixed lookup of this container for decorators and computed property names
    • fixed crash on parameter properties and special JS property assignments
  • most rules can now handle excessively deep AST structures, e.g. concatenating 5000 strings

v0.22.0

:warning: Breaking Changes:

  • TypeScript <3.9 is no longer supported
  • Node.js v8, v11 and v13 are no longer supported

Features:

  • Added support for typescript v3.9, v4.0 and v4.1
    • Fixes compile errors and crashes in existing code and tests
    • This does not contain full support for all language features added in those versions
  • //@ts-nocheck in .ts files now disables rules with type information for that file, as it was already the case in .js files

v0.21.1

Bugfixes:

  • wotan: properly handle backslashes in Windows paths to not report "is not included in any of the projects"

v0.21.0

:warning: Breaking Changes:

  • TypeScript v3.1 and v3.2 is no longer officially supported
  • Node.js v6 is no longer supported
  • Rule.supports can now return a string respresenting the reason for not supporting the file
  • Linter#lintAndFix now requires a ProgramFactory instead of Program
  • Linter#lintAndFix UpdateFileCallback is now expected to only return a SourceFile
  • no-inferred-empty-object was renamed to no-uninferred-type-parameter

Features:

  • rules now debuglog the reason for not supporting a certain file
  • performance improvements
    • when linting with --project --references
      • parsed tsconfig.json files are cached for all project references
    • when linting with --project --fix
      • the project's dependency graph is recalculated lazily the next time a typed rule reuqests type information after fixing a file
      • module resolutions are cached between fixes
  • no-uninferred-type-parameter properly handles new default constraint unknown
  • no-uninferred-type-parameter now detects uninferred type parameters in JS code falling back to any
  • no-uninferred-type-parameter correctly handles higher order function types
  • no-useless-initializer checks array destructuring
  • better handling of computed property names
  • better handling of object and array destructuring assignments

Bugfixes:

  • comments are now included in the transpiled code and declaration files, this makes JSDoc and deprecations visible to API consumers

v0.20.0

:tada: Since the last release we published an official extension for VSCode.

:warning: Breaking Changes:

  • TypeScript v3.0 is no longer officially supported

Features:

  • bifrost: pass names of all linted files to TSLint formatters
  • new rule: no-useless-destructuring
  • no-useless-assertion: detect redundant as const assertions
  • no-useless-assertion: stricter checks of literal type assertions in const context ({ prop: 1 as 1 } as const)
  • no-inferred-empty-object: correctly handle higher order function type inference (type parameter propagation) and unions of call signatures

Bugfixes:

  • wotan: fixed a crash caused by changes to TypeScript's internal API
  • no-useless-predicate: fixes false positive with typeof {} === 'object'
  • no-useless-assertion: don't treat as const like as any

v0.19.0

Features:

  • new rule: no-useless-try-catch
  • no-useless-predicate: detect comparing a literal type with itself
  • no-useless-predicate: detect redundant uses of key in obj where key is known to always be present in obj

Bugfixes:

  • no-useless-predicate: treat property access on index signatures as potentially undefined
  • no-useless-predicate: don't report expressions as "always truthy" without strictNullChecks
  • no-useless-predicate: avoid nested finding by reporting only the innermost finding

v0.18.0

:warning: Breaking Changes:

  • configuration: patterns (exclude and overrides[].files) match dotfiles, e.g. *.spec.ts now matches .foo.spec.ts.
  • disable comments: handling of nested ranges changed. //wotan-enable-line in a line disabled by //wotan-disable-next-line is ignored
  • API: completely refactored FileFilterFactory, FileFilter, LineSwitchFilterFactory, LineSwitchParser and DefaultLineSwitchParser

Features:

  • unchecked JS files (//@ts-nocheck or checkJs: false) are never linted with type information
  • added report-useless-directives CLI option to report unused and redundant enable and disable comments

Bugfixes:

  • wotan: added missing exports to the public API
  • patterns in configuration files match dotfiles (see breaking changes)

v0.17.0

:tada: This release introduces a plugin for TypeScript's LanguageService. This enables in-editor linting while you type. See the docs for more details.

:warning: Breaking Changes:

  • TypeScript 2.8 and 2.9 is no longer supported
  • API:
    • Failure was renamed to Finding throughout the codebase
    • Resolver adds a new required method getDefaultExtensions
    • Resolver#resolve makes parameters basedir and extensions optional
    • Runner requires a new service FileFilterFactory
    • added severity suggestion

Features:

  • new package @fimbul/mithotyn provides in-editor linting through a TypeScript LanguageService Plugin
  • new severity: suggestion
  • --fix can no longer introduce syntax errors
  • async-function-assignability: checks methods and properties with computed names
  • async-function-assignability: checks method overloads individually
  • new service abstraction FileFilterFactory and FileFilter allow customizing which files are linted
  • @fimbul/ve no longer includes the line break after the opening tag in the linted code
  • @fimbul/ve correctly adjusts the column of findings in the first line if there is no line break after the opening tag
  • prefer-number-methods: fixed finding location

Bugfixes:

  • declaration files no longer contain const enum
  • core services no longer rely on the existence of require
  • YAML configuration can now contain YAML-specific types

v0.16.0

Features:

  • new rule: async-function-assignability
  • handle BigInt types and literals
  • no-duplicate-case: correctly handles BigInt and (bitwise) negation thereof
  • no-invalid-assertion: adds an additional check for asserting BigInts
  • no-useless-predicage: allows comparing typeof v === "bigint"
  • no-duplicate-spread-property: handle spreading of type variables introduced in typescript@3.2

Bugfixes:

  • no-duplicate-case: only use type information if strictNullChecks is enabled to avoid false positives
  • CLI normalizes .. and . in glob patterns and file names
  • no-duplicate-spread-property: works with intersection types

v0.15.0

Features:

  • wotan test now validates test configurations
  • Performance improvements using recently added Node.js file system features
  • Improved caching of directory entries
  • Work around breaking changes in TypeScript API regarding project references
  • --fix now merges replacements of a single fix instead of throwing an error
  • no-useless-spread: added check for JSX spread attributes

Bugfixes:

  • no-useless-initializer: removed unreliable fix for object destructuring
  • no-useless-initializer: fixed false positive in destructuring when property is a type parameter or conditional type

v0.14.0

Features:

  • Added support for Project References added in TypeScript 3.0.0
    • Correctly process tsconfig.json containing references
    • Log no warning on empty files array if there are references
    • Added -r or --references CLI option to recursively lint all references. This works similar to tsc --build but doesn't build a dependency graph. Instead it processes the projects depth-first in their specified order.
  • Allow linting multiple projects in one run by specifiying -p or --project multiple times
  • If a file was not found, report the projects it was searched in

Bugfixes:

  • typecheck: correctly report declaration errors with "composite": true

v0.13.0

:warning: Breaking Changes:

  • Node.js v9 is no longer officially supported
  • TypeScript v2.7 is no longer officially supported

Features:

  • new rule: no-restricted-property-access
  • new rule: no-useless-strict
  • no-useless-declare: declare keyword is useless on exported declarations in declaration files

Bugfixes:

  • no-duplicate-spread-property: correctly handles computed names
  • no-duplicate-spread-property: exclude class getters and setters like it's already done for class methods
  • no-duplicate-spread-property: no error on getter and setter pair
  • no-invalid-assertion: handle intersection types
  • prefer-for-of: don't suggest for-of if implementation of iteration protocol contains private or protected members
  • CLI: fixed handling of --version
  • CLI: correctly handle absolute paths
  • fixed corrupted internal state during autofixing with --project without typed rules

v0.12.0

Features:

  • no-inferred-empty-object: handle multiple JSDoc @template tags starting from TypeScript@3.0.0
  • no-unstable-api-use: better error message for signatures
  • no-useless-initializer: check computed names in destructuring

Bugfixes:

  • no-return-await, await-only-promise, no-useless-assertion: fixer looks into tagged templates when parenthesizing
  • prefer-dot-notation: fixer adds parens around numeric literals
  • type-assertion: no longer emit invalid code when fixing to classic style

v0.11.0

:warning: Breaking Changes:

  • 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 checks isFinite 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 types
  • no-useless-predicate: handle intersection types
  • prefer-for-of: ensure iterated object implements iteration protocol
  • prefer-for-of: ensure iterator yields the same type as index signature
  • no-unstable-api-use: check element access with well-known symbols

v0.10.0

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 with Number.NaN

v0.9.0

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 allows for-await-of with Iterable<PromiseLike<any>>, previously it only allowed AsyncIterable<any>
  • no-duplicate-case added check for unions of literal types
  • no-inferred-empty-object handles generic functions declared in JSDoc
  • no-useless-assertion fixed detection if variable may be used before being assigned and thus the non-null assertion is actually necessary

v0.8.0

Features:

  • new rule: no-invalid-assertion
  • no-inferred-empty-object checks JSX elements and tagged templates starting from typescript@2.9.0
  • no-useless-initializer checks destructuring defaults

Bugfixes:

  • no-inferred-empty-object correctly checks classes with constructor
  • no-inferred-empty-object correctly checks classes from JavaScript files that have type parameters in JSDoc
  • no-useless-assertion forbids definite assignment assertions on properties with computed name
  • no-return-await wraps object literals returned from shorthand arrow functions in parentheses to avoid syntax errors
  • no-useless-spread no longer autofixes object spread to avoid introducing duplicate key errors
  • --project flag no longer causes a crash when referencing non-existent files
  • valtyr correctly loads custom formatters

Thanks to @aervin for contributing.

v0.7.0

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 types
  • no-useless-predicate: checks comparing typeof with a variable that has a literal type: const str = 'string'; typeof 1 === str;

v0.6.0

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 checks case clauses of switch statements

v0.5.0

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

v0.4.0

This release contains a lot of refactoring and structural changes:

  • renamed await-promise to await-only-promise
  • renamed deprecation to no-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 full wotan runtime.
  • mimir contains all rules, formatters and configuration presets. Together with ymir this package allows rules to be executed in a different runtime without depending on the whole wotan 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 (previously deprecation) also checks @experimental tag

Bugfixes:

no-unused-label no longer forbids labels on statements other than loops and switch

v0.3.0

Features:

valtyr added support for processors via .fimbullinter.yaml

v0.2.0

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.
  • 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
  • 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

v0.1.0

Features:

  • Enabled nightly builds for all packages. These can be installed with yarn add @fimbul/wotan@next @fimbul/ve@next ... (or npm install if you prefer).
  • ve: use SAX parser for performance and avoid false positive matches of <script> tags
  • wotan:
    • New rule typecheck: type errors as lint rule failures (similar to tslint --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 }`
      
  • 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 displays line:col information for files with BOM

v0.0.1 - Initial Release

Packages:

  • @fimbul/wotan: The main linter runtime with a set of core rules and formatters
    • Available formatters: json and stylish (default)
    • Available rules:
      • await-promise warns about unnecessary await on non-Promise values
      • deprecation detects the use of deprecated APIs
      • no-debugger bans debugger; statements
      • no-fallthrough warns about unintentional fallthrough in switch cases
      • no-return-await warns about unnecessary return await foo; where you can just return foo;
      • no-unsafe-finally warns about control flow statements within the finally block
      • no-unused-expression warns about expressions without side-effects whose result is not used
      • no-unused-label does what the name suggests, really
      • no-useless-assertion detects assertions that don't change the type of the expression
      • trailing-newline enforces a line break on the last line of a file
      • try-catch-return-await enforces the use of return await foo; inside try-catch blocks
  • @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.