-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
docs: update documentation for --experimental-strip-types
#19594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The committers listed above are authorized under a signed CLA. |
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
--experimental-strip-types
@nwidynski please update the description of this PR to describe the change you actually made. |
@nwidynski What's the error message you got when using this feature with Node |
@snitin315 I did not compile ESLint locally to test this feature yet, as it just got merged yesterday and hasn't been released. This line here will always resolve to This means we will run into the following error, rendering the To mitigate, we either need to parse the flag manually ourselves or document support for |
You are correct, When I try using the $ npx --node-options='--experimental-strip-types' eslint --flag unstable_native_nodejs_ts_config -c tests/fixtures/ts-config-files/ts/eslint.config.ts
(node:71533) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:71533) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
Oops! Something went wrong! :(
ESLint: 9.23.0
Error: The unstable_native_nodejs_ts_config flag is not supported in older versions of Node.js.
at loadConfigFile (.../eslint/lib/config/config-loader.js:250:11)
at async ConfigLoader.calculateConfigArray (.../eslint/lib/config/config-loader.js:584:23)
at async #calculateConfigArray (.../eslint/lib/config/config-loader.js:765:23)
at async entryFilter (.../eslint/lib/eslint/eslint-helpers.js:287:5)
at async NodeHfs.<anonymous> (.../eslint/node_modules/@humanfs/core/src/hfs.js:574:24)
at async NodeHfs.walk (.../eslint/node_modules/@humanfs/core/src/hfs.js:614:3)
at async globSearch (.../eslint/lib/eslint/eslint-helpers.js:329:20)
at async Promise.allSettled (index 0)
at async globMultiSearch (.../eslint/lib/eslint/eslint-helpers.js:420:18)
at async findFiles (.../eslint/lib/eslint/eslint-helpers.js:591:24) |
--experimental-strip-types
--experimental-strip-types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
The
process.features.typescript
flag, which #19401 relies on, was added in Node.jsv22.10
, meaning there currently is only support for>= v22.10.0.
Manually parsing the flag to supportv22.6.x - v22.9.x
is pretty cumbersome, so I would suggest to document support only starting>= v22.10.0
👍Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
Adjusted the node version in
configuration-files
docs to accurately reflect #19401 limitations.Is there anything you'd like reviewers to focus on?