
Highlights
basePath property in config objects
Config objects can now include the new basePath property to specify the path to a subdirectory to which the config object should apply to. If a config object has a basePath property, patterns specified in files and ignores are evaluated relative to the subdirectory represented by basePath. This makes it easier to write config objects that target a particular directory inside your project.
// eslint.config.js
import { defineConfig } from "eslint/config";
import js from "@eslint/js";
export default defineConfig([
{
basePath: "packages/hello-base-path",
plugins: { js },
extends: ["js/recommended"],
ignores: ["coverage/**", "dist/**"],
},
]);
You can read more about base paths in config objects in the documentation.
Stable feature flag v10_config_lookup_from_file
With the addition of the basePath property in config objects, the experimental configuration file resolution introduced in ESLint v9.12.0 has been finalized. It will become the default behavior in the next major release of ESLint. Accordingly, the feature flag unstable_config_lookup_from_file has been renamed to v10_config_lookup_from_file. The old flag name still works, so if you are already using unstable_config_lookup_from_file in your setup, you don’t need to take any action.
New allowSeparateTypeImports option in no-duplicate-imports
With the new option allowSeparateTypeImports, the no-duplicate-imports rule can now be configured to treat import and import type as separate usages, even if they specify the same module.
/*eslint no-duplicate-imports: ["error", { "allowSeparateTypeImports": false }]*/
import { someValue } from 'module';
import type { SomeType } from 'module';
Other notable changes
- The
SourceCodemethodgetIndexFromLocnow throws an error if the argument specifies a negative value for thecolumnproperty.
Features
52a5fcafeat: SupportbasePathproperty in config objects (#19879) (Milos Djermanovic)4ab4482feat: addallowSeparateTypeImportsoption tono-duplicate-imports(#19872) (sethamus)b8a7e7afeat: throw error when column is negative ingetIndexFromLoc(#19831) (루밀LuMir)
Bug Fixes
6a0f164fix: handlenulltypelocingetIndexFromLocmethod (#19862) (루밀LuMir)3fbcd70fix: update error message forno-restricted-properties(#19855) (Tanuj Kanti)7ef4cf7fix: remove unnecessary semicolon from fixes (#19857) (Francesco Trotta)7dabc38fix: useprocess.versionin--env-info(#19865) (TKDev7)
Documentation
8662ed1docs: adopt eslint-stylistic sub packages related changes (#19887) (ntnyq)20158b0docs: typo in comment for unused variables handling (#19870) (leopardracer)ebfb5b4docs: Fixed Typo in configuration-files.md (#19873) (0-20)4112fd0docs: clarify that boolean is still allowed for rulemeta.deprecated(#19866) (Bryan Mishkin)
