Skip to content

Next gen style: ESLint Stylistic #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed

Next gen style: ESLint Stylistic #212

wants to merge 6 commits into from

Conversation

cwillisf
Copy link
Contributor

@cwillisf cwillisf commented Mar 26, 2025

Resolves

Proposed Changes

Primary change: implement new style rules based on ESLint Stylistic.

Supporting changes:

  • Upgrade to eslint@^9
  • Use new flat format required by eslint@^9
  • Move flattened legacy configs into legacy/

Bonus changes:

  • The new configurations can lint JS/TS embedded in MD and HTML files

Reason for Changes

  1. Reduce the need for maintenance on these rules by outsourcing to ESLint Stylistic.
  2. This adjusts our style to be much closer to what the cool kids are doing these days the dominant styles in the JS/TS development community.

Test Coverage

Tested on the files in this repository. I also created a temporary HTML file to verify that those rules work.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a major update to the ESLint configuration by adopting the new flat config format required for eslint@^9 and integrating ESLint Stylistic rules. Key changes include the removal of legacy configuration files (release.config.js, react.js, node.js, index.js, es6.js), the addition of new config files under lib/ (for web, React, Node, and legacy support), and updates to documentation and commitlint config.

Reviewed Changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
release.config.js Removed the legacy release configuration.
release.config.cjs Added a new CommonJS release configuration file.
react.js & node.js Removed legacy React and Node configurations.
lib/web.mjs Introduces the web configuration using the new flat config format.
lib/shared/makeConfig.mjs Provides a helper function to generate ESLint configurations with new plugins.
lib/react.mjs & lib/node.mjs Added updated ESLint configurations for React and Node environments.
lib/legacy/* Added legacy configurations split into separate files for React, Node, ES6, etc.
lib/index.mjs New central export that utilizes makeConfig for production configs.
eslint.config.mjs New flat config export file for ESLint.
commitlint.config.mjs Updated commitlint config formatting.
README.md Revised documentation to reflect ESLint upgrade and usage instructions.
Files not reviewed (2)
  • .editorconfig: Language not supported
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

lib/shared/makeConfig.mjs:6

  • Directly importing from an internal path of 'eslint-plugin-html' may be fragile if the package's internal structure changes. Consider using a documented public API or verifying that this path remains supported in future releases.
import htmlSettings from 'eslint-plugin-html/src/settings.js'

@cwillisf cwillisf changed the title Next gen style Next gen style: ESLint Stylistic Mar 28, 2025
@cwillisf cwillisf closed this Mar 31, 2025
@cwillisf cwillisf deleted the next-gen-style branch March 31, 2025 15:00
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant