What minimal example or steps are needed to reproduce the bug?
-
package.json
{
"name": "testcase",
"version": "1.0.0",
"type": "module",
"dependencies": {
"@types/node": "25.3.5",
"stylelint": "17.4.0",
"typescript": "5.9.3"
}
}
-
index.ts
import stylelint from "stylelint";
npm install
npx tsc --module nodenext --strict index.ts
What minimal configuration is needed to reproduce the bug?
Not Applicable.
How did you run Stylelint?
Not Applicable.
Which Stylelint-related dependencies are you using?
None.
What did you expect to happen?
No error.
What actually happened?
node_modules/stylelint/types/stylelint/index.d.ts:4:44 - error TS7016: Could not find a declaration file for module 'css-tree'. '/home/regseb/testcase/node_modules/css-tree/cjs/index.cjs' implicitly has an 'any' type.
Try `npm i --save-dev @types/css-tree` if it exists or add a new declaration (.d.ts) file containing `declare module 'css-tree';`
4 import type { Lexer as CSSTreeLexer } from 'css-tree';
~~~~~~~~~~
Found 1 error in node_modules/stylelint/types/stylelint/index.d.ts:4
Do you have a proposal to fix the bug?
Add @types/css-tree in dependencies.
The bug has been present since version 17.3.0. Maybe the PR Refactor CSSTree lexer creation #9067
What minimal example or steps are needed to reproduce the bug?
package.json{ "name": "testcase", "version": "1.0.0", "type": "module", "dependencies": { "@types/node": "25.3.5", "stylelint": "17.4.0", "typescript": "5.9.3" } }index.tsnpm installnpx tsc --module nodenext --strict index.tsWhat minimal configuration is needed to reproduce the bug?
Not Applicable.
How did you run Stylelint?
Not Applicable.
Which Stylelint-related dependencies are you using?
None.
What did you expect to happen?
No error.
What actually happened?
Do you have a proposal to fix the bug?
Add
@types/css-treeindependencies.The bug has been present since version 17.3.0. Maybe the PR Refactor CSSTree lexer creation #9067