eslint-config-canonical
eslint-plugin-unicorn
Our great sponsors
eslint-config-canonical | eslint-plugin-unicorn | |
---|---|---|
7 | 39 | |
567 | 3,829 | |
- | - | |
8.2 | 8.6 | |
2 months ago | 3 days ago | |
JavaScript | JavaScript | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
eslint-config-canonical
-
semver: v1 vs v1000
It's something that keeps coming up in GitHub issues on my various projects... they point at my project version, which could be v7, v28, v33, and then say "This project versioning is bad." or "This project API is unstable.", etc. and then compare them to projects that are v1, as if that somehow proves their point.
-
Why is is prettier used if eslint can format?
For anyone would would like to migrate from Prettier to ESLint, https://github.com/gajus/eslint-config-canonical covers everything that Prettier does and a lot (a lot) more.
-
ESLint plugin for Storybook
Should we add it to https://github.com/gajus/eslint-config-canonical ?
- eslint-config-canonical: 1,000+ rules ESLint rules
eslint-plugin-unicorn
- JS Array.foreach vs for-loops, pros and cons, which do you use and why
-
Code Review chronicles: destructuring, linting and one valid reason for Typescript
Default parameters should not be passed to a function through an object literal. The foo = {a: false} parameter works fine if only used with one option. As soon as additional options are added, you risk replacing the whole foo = {a: false, b: true} object when passing only one option: {a: true}. For this reason, object destructuring should be used instead. Linter rule
-
eslint-config-canonical: 1,000+ rules ESLint rules
Another thing I should mention is that in contrast to other rulesets, Canonical is very much leaning towards cutting edge technology. It will always suggest latest syntax / APIs when there are new alternatives. Some like that because it makes them aware of better / new ways of doing things, others hate it because they are used to the old ways of doing things. A great example of this is prefer-object-from-entries, which tells you to use fromEntries over reduce when the former makes the code simpler.
-
Replacing let with const – Even when it feels impossible
eslint-plugin-unicorn’s no-array-for-each rule
-
To improve readability for numbers, you can use underscore as a separator!
We actually enforce this code style for any numbers greater than 5 digits at my workplace, using eslint-plugin-unicorn and its numeric-separators-style rule.
-
60+ useful ESLint rules
explicit-length-check - Enforce explicitly comparing the length property of a value.
I think the example in the rule is pretty clear. If you have any specific feedback, we're happy to listen.
It's definitely not for everyone, especially if you can't control how your variables are written, but that's part of the beauty of ESLint. This rule has the potential to add value to someone's codebase, so you can adopt it, disable it, or customize it with its many options.
no-for-loop - Do not use a for loop that can be replaced with a for-of.
What are some alternatives?
eslint-config-xo - ESLint shareable config for XO
eslint-plugin-react-hooks-addons - ESLint rule to check unused and potentially unnecessary dependencies in useEffect hook.
proposal-numeric-separator - A proposal to add numeric literal separators in JavaScript.
putout - 🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter with built-in ESLint and Babel support for js, jsx typescript, flow, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏
eslint-plugin-boundaries - Eslint plugin checking architecture boundaries between elements
proposal-observable - Observables for ECMAScript
eslint-plugin-proper-ternary - ESLint rules to ensure proper usage of ternary/conditional expressions
quick-lint-js - quick-lint-js finds bugs in JavaScript programs
eslint-plugin-github - An opinionated collection of ESLint rules used by GitHub.
picoc - A very small C interpreter
eslint-plugin-i18n-json - Fully extendable eslint plugin for JSON i18n translation files.
eslint-plugin-import-helpers - ESLint plugin to help enforce a configurable order for import statements