-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: Add more type definitions #81
Conversation
packages/core/src/types.ts
Outdated
/** | ||
* Represents the configuration options for the core linter. | ||
*/ | ||
export interface LinterOptionsConfig { | ||
/** | ||
* Indicates whether or not inline configuration is evaluated. | ||
*/ | ||
allowInlineConfig?: boolean; | ||
|
||
/** | ||
* Indicates what to do when an unused disable directive is found. | ||
*/ | ||
reportUnusedDisableDirectives?: boolean | SeverityName; | ||
} |
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.
These are options passed to Linter#verify()
(VerifyOptions
), not linterOptions
in config objects?
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.
No, this is for the config object. What am I missing?
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.
In config objects (e.g., in an eslint.config.js
file), linterOptions
objects have properties:
noInlineConfig
: allowed values aretrue
,false
.reportUnusedDisableDirectives
: allowed values are"error"
,"warn"
,"off"
,2
,1
,0
, and also legacytrue
,false
. https://github.com/eslint/eslint/blob/7bcda760369c44d0f1131fccaaf1ccfed5af85f1/lib/config/flat-config-schema.js#L287-L305
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.
Ah, so just missed the numbers. Thanks.
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
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!
Prerequisites checklist
What is the purpose of this pull request?
Add some more low-hanging fruit types to
@eslint/core
What changes did you make? (Give an overview)
Added several more types to
@eslint/core
that we can make use of now.Related Issues
Is there anything you'd like reviewers to focus on?