TypeScript Rewrite

  • Rework the project structure
    • Switch to ESM modules & TypeScript
    • Switch from the bin/ directory to using commands inside package.json
    • Bundle the configuration into a single file
    • Replace jest with vitest
  • Rework testing strategy
    • All plugins are now checked in the same test suite
    • Test are now checked in the following aspects:
      • Whether they are defined
      • Whether the rule has a valid configuration according to the rule schema
      • Whether it is not deprecated
    • A rule can be manually marked as skipped if it is deprecated or has a broken schema
      • The list of skipped rules is available inside tests/utils/skipped.ts
    • The linting stage now works as a test as well
      • Some rules can pass as properly defined according to their schema, but will fail once loaded by ESLint due to malformed schema.
      • Actually running the built configuration ensures it is working correctly.
  • Rule changes:
    • Added:
      • logical-assignment-operators: ['error', 'never']
      • no-constant-binary-expression: 'error'
      • no-empty-static-block: 'error'
      • no-new-native-nonconstructor: 'error'
      • no-object-constructor: 'error'
      • import/no-empty-named-blocks: 'error'
      • import/consistent-type-specifier-style: ['error', prefer-top-level']
      • @typescript-eslint/block-spacing: ['error', 'never']
      • @typescript-eslint/class-methods-use-this: 'off'
      • @typescript-eslint/consistent-generic-constructors: ['error', 'constructor']
      • @typescript-eslint/default-param-last: 'error'
      • @typescript-eslint/key-spacing: ['error', {beforeColon: false, afterColon: true, mode: 'strict'}]
      • @typescript-eslint/lines-around-comment: 'off'
      • @typescript-eslint/no-duplicate-enum-values: 'error'
      • @typescript-eslint/no-duplicate-type-constituents: 'error'
      • @typescript-eslint/no-import-type-side-effects: 'off'
      • @typescript-eslint/no-mixed-enums: 'error'
      • @typescript-eslint/no-unsafe-declaration-merging: 'error'
      • @typescript-eslint/no-unsafe-enum-comparison: 'error'
      • @typescript-eslint/no-unsafe-unary-minus: 'error'
      • @typescript-eslint/parameter-properties: 'error'
      • @typescript-eslint/prefer-destructuring: ['error', {object: true, array: false}, {enforceForRenamedProperties: false, enforceForDeclarationWithTypeAnnotation: false}]
      • @typescript-eslint/sort-type-constituents: ['error', {checkIntersections: true, checkUnions: true, groupOrder: ['conditional', 'function', 'import', 'import', 'intersection', 'keyword', 'literal', 'named', 'nullish', 'object', 'operator', 'tuple', 'union']]
    • Modified:
      • default-param-last: 'off' - turned off in favor of the @typescript-eslint rule
      • key-spacing: 'off' - turned off in favor of the @typescript-eslint rule
      • no-shadow: 'off' - turned off in favor of the @typescript-eslint rule
      • import/first: - extended to full configuration
      • import/no-relative-packages - ['off'] => 'off'
      • @typescript-eslint/default-param-last: 'error'
      • @typescript-eslint/member-ordering - removed private-abstract-field as it was removed from the plugin
      • @typscript-eslint/prefer-nullish-coalescing - removed forceSuggestionFixer option as it was removed from the plugin
      • @typescript-eslint/prefer-optional-chain - made the options more verbose
      • @typescript-eslint/restrict-plus-operands - removed checkCompoundAssignments option as it was removed from the plugin
      • @typescript-eslint/semi: - extended to full configuration
      • @typescript-eslint/switch-exhaustiveness-check: - extended to full configuration
      • @typescript-eslint/unified-signatures: - extended to full configuration
    • Removed
      • @typescript-eslint/no-duplicate-imports deleted from the plugin, switched to the native rule
      • @typescript-eslint/no-implicit-any-catch deleted from the plugin
      • @typescript-eslint/no-type-alias deprecated by the plugin
      • @typescript-eslint/sort-type-union-intersection-members deleted from the plugin
      • import/imports-first - deprecated by the plugin

Merge request reports

Loading