Skip to content

v11.0.0: Update rules to match HTML Academy codeguide#103

Open
meritt wants to merge 7 commits intomasterfrom
next
Open

v11.0.0: Update rules to match HTML Academy codeguide#103
meritt wants to merge 7 commits intomasterfrom
next

Conversation

@meritt
Copy link
Copy Markdown
Member

@meritt meritt commented Apr 13, 2026

Major update of ESLint config aligned with htmlacademy/codeguide#75.

Breaking Changes

  • Minimum Node.js version: 24
  • Minimum ESLint version: 10
  • TypeScript >=5 required as peer dependency
  • Flat config format only (not compatible with .eslintrc)
  • ES modules only ("type": "module")
  • Removed legacy configs: es5, es5.5, es6 (rules merged into vanilla)
  • index.js is now a barrel re-export, not a depends list

Dependencies

Package Before After
eslint (peer) >=7 >=10
eslint (dev) 8.48.0 ^10.2.0
typescript (peer) >=5
@eslint/js ^10.0.0
@stylistic/eslint-plugin ^5.10.0
@eslint-react/eslint-plugin ^4.2.0
eslint-plugin-check-file 2.6.2 ^3.3.0
eslint-plugin-n ^17.24.0
eslint-plugin-unicorn 46.0.0 ^64.0.0
typescript-eslint ^8.58.0
eslint-plugin-node ^11.1.0 removed
eslint-plugin-react ^7.32.2 removed

ESLint Rules

vanilla.js

Rules from removed es5.js / es5.5.js / es6.js merged in: guard-for-in, no-caller, no-eval, no-extend-native, no-extra-bind, no-implied-eval, no-invalid-this, no-iterator, no-labels, no-lone-blocks, no-multi-str, no-new, no-new-func, no-new-wrappers, no-octal-escape, no-proto, no-script-url, no-sequences, no-throw-literal, no-with, consistent-return, max-nested-callbacks, yoda.

New

  • prefer-rest-params — use rest params instead of arguments

  • prefer-spread — use spread syntax instead of .apply()

  • no-object-constructor — disallows new Object() (replaces deprecated no-new-object)

  • object-shorthand: ['error', 'always', {avoidQuotes: true}] — enforces shorthand
    properties/methods in object literals, except when the key requires quoting

  • @stylistic/function-call-spacing: ['error', 'always'] — requires space before call
    parentheses: fn () instead of fn() (HTML Academy convention)

  • @stylistic/generator-star-spacing: ['error', 'after']function* gen() style

  • @stylistic/rest-spread-spacing — no space after rest/spread operator

  • @stylistic/yield-star-spacing: ['error', 'after']yield* expression style

  • @stylistic/no-floating-decimal — requires leading zero: 0.5 instead of .5

  • @stylistic/comma-style — comma at the end of the line, not the beginning

  • @stylistic/computed-property-spacing — no spaces inside computed property brackets

  • @stylistic/key-spacing — consistent spacing around colon in object keys

  • @stylistic/keyword-spacing — space before/after keywords (if, else, return, etc.)

  • @stylistic/lines-between-class-members — blank line between class members (except
    after single-line members)

  • @stylistic/no-extra-semi — no unnecessary semicolons

Modified

Rule Before After
comma-dangle 'only-multiline' 'always-multiline'
quotes {allowTemplateLiterals: true} {allowTemplateLiterals: 'always'}

comma-dangle: 'always-multiline' requires trailing commas in multiline constructs (previously only allowed them).

Removed

  • valid-jsdoc — deprecated in ESLint, removed
  • no-new-object — replaced by no-object-constructor
  • linebreak-style — removed
  • no-process-exit — moved to node.js config scope only

node.js

Modified

Rule Before After
node/*n/* eslint-plugin-node eslint-plugin-n
@typescript-eslint/no-shadow 'error' ['error', {hoist: 'all'}]

Cleaned up: removed 12 disabled/off rules that provided no value (node/no-exports-assign, node/exports-style, node/no-sync, node/no-process-env, etc.)

react.js

Plugin replacement: react/*@eslint-react/*, JSX formatting → @stylistic/jsx-*.

Before After
react/no-array-index-key @eslint-react/no-array-index-key
react/no-access-state-in-setstate @eslint-react/no-access-state-in-setstate
react/jsx-no-useless-fragment @eslint-react/no-useless-fragment
react/jsx-closing-bracket-location @stylistic/jsx-closing-bracket-location
react/jsx-closing-tag-location @stylistic/jsx-closing-tag-location
react/jsx-curly-newline @stylistic/jsx-curly-newline
react/jsx-wrap-multilines @stylistic/jsx-wrap-multilines

Removed

  • react/no-unused-prop-types — not available in @eslint-react
  • react/jsx-boolean-value — not available in @eslint-react

react-typescript.js

Uses tseslint.configs.recommendedTypeChecked + eslintReact.configs['recommended-type-checked']
instead of manual extends.

Modified

Rule Before After
@typescript-eslint/no-shadow 'error' ['error', {hoist: 'all'}]
@typescript-eslint/no-unused-vars ['error'] ['error', {args: 'after-used', argsIgnorePattern: '^_'}]

Removed

  • @typescript-eslint/member-delimiter-style — handled by @stylistic
  • react/jsx-uses-react: 'off' — not needed in @eslint-react
  • react/react-in-jsx-scope: 'off' — not needed in @eslint-react

@meritt meritt self-assigned this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant