ESLint InterlaceESLint Interlace

Flat Config Migration

Migrate from .eslintrc to ESLint 9.x flat config

Overview

ESLint 9.x introduces a new "flat config" format that replaces the legacy .eslintrc.* files. All ESLint Interlace plugins support flat config natively.

Migration Steps

Remove legacy config files

Delete your existing .eslintrc.js, .eslintrc.json, or .eslintrc.yaml files.

Create eslint.config.js

Create a new eslint.config.js file in your project root:

eslint.config.js
import browserSecurity from 'eslint-plugin-browser-security';
import secureCoding from 'eslint-plugin-secure-coding';

export default [
  browserSecurity.configs.recommended,
  secureCoding.configs.recommended,
];

Update package.json scripts

Ensure your lint script uses the new config:

package.json
{
  "scripts": {
    "lint": "eslint ."
  }
}

Legacy Config Comparison

eslint.config.js
import browserSecurity from 'eslint-plugin-browser-security';

export default [
  browserSecurity.configs.recommended,
  {
    rules: {
      'browser-security/no-insecure-url': 'error',
    },
  },
];
.eslintrc.json
{
  "plugins": ["browser-security"],
  "extends": ["plugin:browser-security/recommended"],
  "rules": {
    "browser-security/no-insecure-url": "error"
  }
}

On this page