Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
eslint-plugin-typescript-sort-keys
Advanced tools
Sort interface and string enum keys
Inspired by and sourced from eslint/sort-keys
You'll first need to install
yarn add -D eslint typescript @typescript-eslint/parser
Next, install eslint-plugin-typescript-sort-keys
:
yarn add -D eslint-plugin-typescript-sort-keys
Note: If you installed ESLint globally then you must also install eslint-plugin-typescript-sort-keys
globally.
Specify the parser for typescript files in your .eslintrc
configuration file:
{
"parser": "@typescript-eslint/parser"
}
Add typescript-sort-keys
to the plugins section. You can omit the eslint-plugin-
prefix:
{
"plugins": ["typescript-sort-keys"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"typescript-sort-keys/interface": "error",
"typescript-sort-keys/string-enum": "error"
}
}
Or enable all rules with defaults
{
"extends": ["plugin:typescript-sort-keys/recommended"]
}
Key: :heavy_check_mark: = recommended, :wrench: = fixable
Name | Description | :heavy_check_mark: | :wrench: |
---|---|---|---|
typescript-sort-keys/interface | require interface keys to be sorted | :heavy_check_mark: | :wrench: |
typescript-sort-keys/string-enum | require string enum members to be sorted | :heavy_check_mark: | :wrench: |
[3.3.0] - 2024-10-05
FAQs
Sort interface and string enum keys
The npm package eslint-plugin-typescript-sort-keys receives a total of 289,462 weekly downloads. As such, eslint-plugin-typescript-sort-keys popularity was classified as popular.
We found that eslint-plugin-typescript-sort-keys demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.