eslint
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
@eslint-community/eslint-utils | 4.4.0 | 62.2 kB | MIT | prod | |
@eslint-community/regexpp | 4.10.0 | 65.3 kB | MIT | prod | |
@eslint/eslintrc | 2.1.4 | 123.27 kB | MIT | prod | |
@eslint/js | 8.56.0 | 3.69 kB | MIT | prod | |
@humanwhocodes/config-array | 0.11.14 | 14.84 kB | Apache-2.0 | prod | |
@humanwhocodes/module-importer | 1.0.1 | 6.92 kB | Apache-2.0 | prod | |
@nodelib/fs.walk | 1.2.8 | 7.19 kB | MIT | prod | |
@ungap/structured-clone | 1.2.0 | 6.89 kB | ISC | prod | |
ajv | 6.12.6 | 197.63 kB | MIT | prod | |
chalk | 4.1.2 | 11.31 kB | MIT | prod | |
cross-spawn | 7.0.3 | 7.3 kB | MIT | prod | |
debug | 4.3.4 | 12.94 kB | MIT | prod | |
doctrine | 3.0.0 | 21.83 kB | Apache-2.0 | prod | |
escape-string-regexp | 4.0.0 | 1.97 kB | MIT | prod | |
eslint-scope | 7.2.2 | 25.33 kB | BSD-2-Clause | prod | |
eslint-visitor-keys | 3.4.3 | 7.92 kB | Apache-2.0 | prod | |
espree | 9.6.1 | 15.95 kB | BSD-2-Clause | prod | |
esquery | 1.5.0 | 155.76 kB | BSD-3-Clause | prod | |
esutils | 2.0.3 | 9.32 kB | BSD-2-Clause | prod | |
fast-deep-equal | 3.1.3 | 3.57 kB | MIT | prod | |
file-entry-cache | 6.0.1 | 7.61 kB | MIT | prod | |
find-up | 5.0.0 | 3.72 kB | MIT | prod | |
glob-parent | 6.0.2 | 3.37 kB | ISC | prod | |
globals | 13.24.0 | 9.35 kB | MIT | prod | |
graphemer | 1.4.0 | 57.01 kB | MIT | prod | |
ignore | 5.3.1 | 14.1 kB | MIT | prod | |
imurmurhash | 0.1.4 | 4.21 kB | MIT | prod | |
is-glob | 4.0.3 | 4.16 kB | MIT | prod | |
is-path-inside | 3.0.3 | 1.95 kB | MIT | prod | |
js-yaml | 4.1.0 | 99.96 kB | MIT | prod | |
json-stable-stringify-without-jsonify | 1.0.1 | 4.51 kB | MIT | prod | |
levn | 0.4.1 | 7.29 kB | MIT | prod | |
lodash.merge | 4.6.2 | 12.77 kB | MIT | prod | |
minimatch | 3.1.2 | 11.66 kB | ISC | prod | |
natural-compare | 1.4.0 | 2.45 kB | MIT | prod | |
optionator | 0.9.4 | 48.98 kB | MIT | prod | |
strip-ansi | 6.0.1 | 1.99 kB | MIT | prod | |
text-table | 0.2.0 | 3.81 kB | MIT | prod |
ESLint is a highly versatile tool that helps developers identify and report on patterns found in ECMAScript or JavaScript code. Similar to JSLint and JSHint, it improves the quality of your code by checking for common coding errors and enforcing your desired coding conventions. ESLint is distinguished by its complete pluggability, meaning every rule is a plugin that can be adjusted or extended.
To use ESLint, you need to first install it in your project. The GitHub readme provides a straightforward guide on how to do this. You can install ESLint to your project by running the command npm init @eslint/config
in your terminal.
After successfully installing ESLint, you can run it on any file or directory in your project with the following command: ./node_modules/.bin/eslint yourfile.js
.
ESLint also allows you to configure the rules that it enforces. This is achieved by editing the .eslintrc
file in your directory. Here's an example of how such configuration might look:
{
"rules": {
"semi": ["error", "always"],
"quotes": ["error", "double"]
}
}
In this particular example, two rules are declared: The "semi" rule, which enforces the use of semicolons at the end of statements, and the "quotes" rule, which enforces the use of double quotes for string literals.
You can find exhaustive documentation on how to use and configure ESLint at https://eslint.org. It includes a detailed user guide that explains how to install, configure, and use ESLint. The documentation also includes practical examples that demonstrate the different ways to use ESLint, as well as a comprehensive list of available rules that you can use to customize how ESLint works in your project.