ESLint Config Enact
raw JSON → 5.1.0 verified Sat Apr 25 auth: no javascript
ESLint configuration package for Enact applications, currently at version 5.1.0. This package provides a shareable ESLint flat config with Enact team's standard and strict rule sets. It targets Node ^20.12.0 || ^22.0.0 || >=24.0.0 and requires ESLint ^9.20.0. Key differentiators: opinionated rules for Enact framework, includes React, React Hooks, Babel, Jest, and Enact-specific plugins. Recent major updates: migrated to ESLint v9 flat config (v5.0.0-alpha.5), removed deprecated prop-types rule (v5.0.0-beta.1), and disabled React compiler-related rules (v5.0.3). Release cadence is irregular, with breaking changes in major versions.
Common errors
error Cannot find module 'eslint-config-enact' ↓
cause Package not installed or not in node_modules
fix
Run 'npm install eslint-config-enact --save-dev'
error Failed to load config "enact" to extend from ↓
cause Using deprecated eslintrc format (extends) instead of flat config
fix
Migrate to eslint.config.js and use import like: import enact from 'eslint-config-enact'; export default [...enact];
error ESLintError: ConfigError: Config (unnamed): key "rules" must be an object ↓
cause Incorrect usage of flat config spreading
fix
Ensure you spread the array correctly: export default [...enact, { rules: {...} }];
error Failed to load parser '@babel/eslint-parser' ↓
cause Missing @babel/eslint-parser dependency
fix
Install @babel/eslint-parser as a dev dependency.
Warnings
breaking Migrated to ESLint v9 flat config and removed eslintConfig from package.json ↓
fix Use flat config format in eslint.config.js; see changelog for migration.
breaking Removed deprecated rule enact/prop-types ↓
fix Use standard React prop-types rule alternatively.
breaking Minimum Node version changed to ^20.12.0 || ^22.0.0 || >=24.0.0 ↓
fix Update Node to 20.12+ or use older config version.
breaking Replaced deprecated rule no-new-object with no-object-constructor ↓
fix Update your custom rule configurations accordingly.
gotcha Enact config requires eslint-plugin-enact to be installed ↓
fix Install eslint-plugin-enact as a dev dependency.
Install
npm install eslint-config-enact yarn add eslint-config-enact pnpm add eslint-config-enact Imports
- default wrong
const enact = require('eslint-config-enact')correctimport enact from 'eslint-config-enact' - enact
import enact from 'eslint-config-enact' - strict
import { strict } from 'eslint-config-enact'
Quickstart
// eslint.config.js
import enact from 'eslint-config-enact';
export default [
...enact,
{
rules: {
// your overrides
}
}
];