eslint-config-trendmicro

raw JSON →
4.4.1 verified Fri May 01 auth: no javascript

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.

error Failed to load config "trendmicro" to extend from.
cause Using .eslintrc with 'extends: "trendmicro"' which is unsupported in v4.
fix
Migrate to eslint.config.js and import trendmicroConfig as shown in the README.
error Error: Cannot find module 'eslint-config-trendmicro'
cause Package not installed or version incompatible with ESLint.</s>
fix
Run npm install --save-dev eslint-config-trendmicro@latest and ensure ESLint version is >=9.
error Error: ESLint configuration is invalid: The value "eslint.config.js" cannot be used as a config file.
cause File extension mismatch or type field missing in package.json.
fix
Use .mjs extension for ESM or .cjs for CommonJS, and ensure package.json has "type": "module" if using .js.
error Parsing error: Unexpected token <
cause Default ESLint parser cannot parse JSX. Need a JSX-compatible parser.
fix
Install @babel/eslint-parser or @typescript-eslint/parser, and set parser in languageOptions.
breaking v4.0.0 dropped support for ESLint v7/v8 and .eslintrc format. Only flat config (eslint.config.js) is supported.
fix Migrate to eslint.config.js using flat config. See README migration guide.
deprecated The version 3.x is deprecated and only maintained for legacy ESLint v7/v8 projects.
fix Upgrade to v4+ and migrate to flat config, or stay on v3 if you must use .eslintrc.
gotcha The default export is an array, not a single config object. Spreading (...) is required when adding custom configs.
fix Export [...trendmicroConfig, { ... }] instead of exporting trendmicroConfig directly.
gotcha Peer dependencies must be installed manually. Running npm install --save-dev eslint-config-trendmicro does not install them automatically.
fix Install peer dependencies: npm install --save-dev eslint @stylistic/eslint-plugin eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
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.
fix Create an additional config object after spreading trendmicroConfig and set languageOptions there.
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.
fix If using TypeScript, use @typescript-eslint/parser and configure parserOptions.project. For Babel, use @babel/eslint-parser.
npm install eslint-config-trendmicro
yarn add eslint-config-trendmicro
pnpm add eslint-config-trendmicro

Shows how to install peer dependencies and create an eslint.config.mjs with trendmicro config and custom rules.

// 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+
    },
  },
];