javascript
javascript copied to clipboard
JavaScript Style Guide
`react/sort-comp` rule of `eslint-plugin-react` support `type-annotations` group, which is useful in FLow and Typescipt project
It seems like the documentation consistently promotes having a new line for each item in multiline lists, whether it be in a [function invocation](https://github.com/airbnb/javascript#functions--signature-invocation-indentation) or in [an array](https://github.com/airbnb/javascript#arrays--bracket-newline) (both of...
For newcomers, it is hard to make their first contribution. Well-Written contributing guidelines can describe the workflow of the projects, and where to start for newcomers, which could help them...
When disabling some eslint rule, it's very easy to make mistakes like not enabling it again, forgetting to remove the disabled rule when the code is refactored... `eslint-plugin-eslint-comments` checks those...
The max-classes-per-file rule is enabled in rules/best-practices.js but there is no mention of this requirement in the docs. If this is a best practice, I'd like to know why.
I noticed that babel-preset-airbnb added the following stage 4 proposals in [v4.2.0](https://github.com/airbnb/babel-preset-airbnb/blob/master/CHANGELOG.md#420---20191114): - @babel/plugin-proposal-nullish-coalescing-operator - @babel/plugin-proposal-optional-chaining Are there any rules/guidelines for these features?
With `[email protected]` the code ```js class Example {} module.exports = Example(); ``` would result in the error: example.js:2:18: A function with a name starting with an uppercase letter should only...
1) The users of this style guide will probably expect that all of the rules that it prescribes will be enforced by eslint. However, this is not the case -...
The documentation for [10.8](https://github.com/airbnb/javascript#modules--multiline-imports-over-newlines) references [`object-curly-newline`](https://github.com/airbnb/javascript#modules--multiline-imports-over-newlines) however object-curly-newline does not catch this rule. Furthermore airbnb's set of rules also doesn't catch this rule. See [Example](https://eslint.org/demo#eyJ0ZXh0IjoiaW1wb3J0IHtmb28sIFxuICAgICAgICBiYXIsIGJheiwgYmFuZ30gZnJvbSAnZm9vLWJhcic7XG5cbmNvbnN0IHRoaW5nID0ge1xuICBmaXJzdCA6IGZvbyxcbiAgc2Vjb25kIDogYmFyLCBcbiAgdGhpcmQgOiBiYXosIGZvdXJ0aCA6IGJhbmdcbn1cblxuY29uc3QgbGlzdCA9IFtcbiAgZm9vLFxuICBiYXIsXG4gIGJheiwgYmFuZ1xuXTtcblxuKGxpc3Q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Im5vLW9iai1jYWxscyI6Miwibm8tb2N0YWwiOjIsIm5vLXByb3RvdHlwZS1idWlsdGlucyI6Miwibm8tcmVkZWNsYXJlIjoyLCJuby1yZWdleC1zcGFjZXMiOjIsIm5vLXNlbGYtYXNzaWduIjoyLCJuby1zaGFkb3ctcmVzdHJpY3RlZC1uYW1lcyI6Miwibm8tc3BhcnNlLWFycmF5cyI6Miwibm8tdGhpcy1iZWZvcmUtc3VwZXIiOjIsIm5vLXVuZGVmIjoyLCJuby11bmV4cGVjdGVkLW11bHRpbGluZSI6Miwibm8tdW5yZWFjaGFibGUiOjIsIm5vLXVuc2FmZS1maW5hbGx5IjoyLCJuby11bnNhZmUtbmVnYXRpb24iOjIsIm5vLXVudXNlZC1sYWJlbHMiOjIsIm5vLXVudXNlZC12YXJzIjoyLCJuby11c2VsZXNzLWNhdGNoIjoyLCJuby11c2VsZXNzLWVzY2FwZSI6Miwibm8td2l0aCI6MiwicmVxdWlyZS15aWVsZCI6MiwidXNlLWlzbmFuIjoyLCJ2YWxpZC10eXBlb2YiOjIsIm9iamVjdC1jdXJseS1uZXdsaW5lIjoyLCJvYmplY3QtY3VybHktc3BhY2luZyI6Miwib2JqZWN0LXByb3BlcnR5LW5ld2xpbmUiOjIsImFycmF5LWJyYWNrZXQtbmV3bGluZSI6MiwiYXJyYXktYnJhY2tldC1zcGFjaW5nIjoyLCJhcnJheS1lbGVtZW50LW5ld2xpbmUiOjJ9LCJlbnYiOnt9fX0=) The guidance is good, however...
Greetings, The second section of the guide is "References", which is a prescription to use "const" over "var". This section showcases a "bad" code example and a "good" code example....