eslint-config-trendmicro
raw JSON →Trend Micro's official ESLint flat config, version 4.4.1, requiring Node >=20 and ESLint >=9. It provides a shareable configuration for React projects with support for JSX accessibility, import ordering, and custom parsers like Babel. Since v4.0.0, it uses the flat config format (eslint.config.js) exclusively, breaking compatibility with .eslintrc files used in v3.x. The config enforces strict stylistic rules via @stylistic/eslint-plugin and includes presets for React hooks. Peer dependencies include @stylistic/eslint-plugin, eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react, and eslint-plugin-react-hooks. Key differentiator: a maintained, opinionated config backed by Trend Micro's frontend team with regular patch and minor releases.
Common errors
error Failed to load config "trendmicro" to extend from. ↓
error Error: Cannot find module 'eslint-config-trendmicro' ↓
error Error: ESLint configuration is invalid: The value "eslint.config.js" cannot be used as a config file. ↓
error Parsing error: Unexpected token < ↓
Warnings
breaking v4.0.0 dropped support for ESLint v7/v8 and .eslintrc format. Only flat config (eslint.config.js) is supported. ↓
deprecated The version 3.x is deprecated and only maintained for legacy ESLint v7/v8 projects. ↓
gotcha The default export is an array, not a single config object. Spreading (...) is required when adding custom configs. ↓
gotcha Peer dependencies must be installed manually. Running npm install --save-dev eslint-config-trendmicro does not install them automatically. ↓
gotcha Custom language options (like globals or parser) must be set in a separate config object, not inside the spread. Overriding languageOptions inside the imported array may be ignored. ↓
gotcha The config enables React JSX rules, which require @babel/eslint-parser or similar for non-standard syntax. Using default ESLint parser may fail on JSX with TypeScript. ↓
Install
npm install eslint-config-trendmicro yarn add eslint-config-trendmicro pnpm add eslint-config-trendmicro Imports
- default (trendmicroConfig) wrong
const trendmicroConfig = require('eslint-config-trendmicro');correctimport trendmicroConfig from 'eslint-config-trendmicro'; - trendmicroConfig (named)
import { default as trendmicroConfig } from 'eslint-config-trendmicro'; - type (if needed)
import type { Linter } from 'eslint';
Quickstart
// Install: npm install --save-dev eslint-config-trendmicro eslint @stylistic/eslint-plugin eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
// eslint.config.mjs
import trendmicroConfig from 'eslint-config-trendmicro';
export default [
...trendmicroConfig,
{
rules: {
'react/jsx-uses-react': 'off', // Not needed with React 17+
'react/react-in-jsx-scope': 'off', // Not needed with React 17+
},
},
];