eslint-config-trendmicro
v4.0.0
Published
Trend Micro's ESLint config.
Downloads
4,573
Readme
eslint-config-trendmicro

This package provides an ESLint flat config as an extensible shared configuration.
Note: v4+ requires ESLint v9 and uses the flat config format (
eslint.config.js). For ESLint v7/v8 with.eslintrc, use v3.x.
Requirements
- Node.js >= 20
- ESLint >= 9
Usage
- Install the latest version of eslint-config-trendmicro:
npm install --save-dev eslint-config-trendmicro@latest- Install the required peer dependencies:
npm install --save-dev eslint eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks- Create an
eslint.config.js(oreslint.config.mjs) in your project root:
ESM (eslint.config.js with "type": "module" in package.json, or eslint.config.mjs):
import trendmicroConfig from 'eslint-config-trendmicro';
export default [
...trendmicroConfig,
{
// your project-specific overrides
rules: {},
},
];CommonJS (eslint.config.cjs):
const trendmicroConfig = require('eslint-config-trendmicro');
module.exports = [
...trendmicroConfig,
{
// your project-specific overrides
rules: {},
},
];Customizing Language Options
You can override languageOptions for your environment:
import trendmicroConfig from 'eslint-config-trendmicro';
import globals from 'globals';
export default [
...trendmicroConfig,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
// your overrides
},
},
];Using with a Custom Parser (e.g. Babel)
import trendmicroConfig from 'eslint-config-trendmicro';
import babelParser from '@babel/eslint-parser';
export default [
...trendmicroConfig,
{
languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ['@babel/preset-react'],
},
},
},
},
];Migrating from v3.x (ESLint v7/v8)
Replace your .eslintrc / .eslintrc.json with an eslint.config.js:
Before (v3.x, .eslintrc):
{
"extends": "trendmicro",
"parser": "@babel/eslint-parser",
"env": {
"browser": true,
"node": true
},
"plugins": ["@babel"],
"rules": {}
}After (v4.x, eslint.config.js):
import trendmicroConfig from 'eslint-config-trendmicro';
import globals from 'globals';
export default [
...trendmicroConfig,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
rules: {},
},
];
