netflix / eslint-config-netflix Goto Github PK
View Code? Open in Web Editor NEWShared ESLint config for Netflix JavaScript
Shared ESLint config for Netflix JavaScript
The package-lock.json
file should always be derived from npm install
- if we manually edit it there is no guarantee that our edits will persist through the next install.
Title says it all — do this after #11 is merged
This should likely be considered a breaking change, as the eslint:recommended
rules have some adjustments:
https://eslint.org/docs/latest/use/migrate-to-9.0.0#eslint-recommended
eslint:recommended
in 3.0warning
override, now error
per eslint:recommended
)warning
override, now error
per eslint:recommended
)See https://eslint.org/blog/2023/10/deprecating-formatting-rules/
Detailed deprecation rationale: eslint/eslint#17522
All of these rules will be deprecated as of the next release, but will not be removed until at least ESLint v10.0.0 (if not later).
Example message for comma-dangle
This rule was deprecated in ESLint v8.53.0. Please use the corresponding rule in @stylistic/eslint-plugin-js.
Title says it all — #11 describes install steps that currently do not work:
npm install --save-dev @Netflix/eslint-config-netflix
Older versions can still be installed via:
npm install --save-dev eslint-config-netflix
Perhaps consider https://typescript-eslint.io/rules/no-require-imports/
Pro: require() is a non-standard holding back the web
Con: this rule would aggressively warn about something that can't be changed in most developer scenarios
See: https://eslint.org/docs/latest/rules/array-callback-return
With the rule enabled, this causes a warning:
const index = list.findLastIndex(candidateId => {
const candidate = input[candidateId];
if (candidate.ok === true) {
return true;
}
});
Developers must instead rewrite like this:
const index = list.findLastIndex(candidateId => {
const candidate = input[candidateId];
if (candidate.ok === true) {
return true;
}
return undefined;
});
Musings: Warning developers to add return undefined;
to conclude some function calls and not others is inconsistent. Requiring developers to add return undefined;
at all seems superfluous.
In #19 we said:
using these methods carry certain semantics. If you don’t want to actually create an object, different methods exist with the appropriate semantics.
Is the rule doing what we expect?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.