pdf.js/web/.eslintrc
Jonas Jenwald 1ceffac9c5 Enable the no-nested-ternary ESLint rule in the web/ directory
This rule is already enabled in mozilla-central, and helps avoid some confusing formatting[1], see https://searchfox.org/mozilla-central/rev/a92ed79b0bc746159fc31af1586adbfa9e45e264/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js#209-210

Since some cases may not be aren't entirely straightforward to convert, and some we probably don't want to change either[2], this patch is limited to the `web/` directory as a proof-of-concept.

Please find additional details about the ESLint rule at https://eslint.org/docs/rules/no-nested-ternary

---
[1] One example with *three* ternary statements: 93aa613db7/src/core/fonts.js (L2623-L2630)

[2] One example that should be whitelisted: 93aa613db7/src/core/jbig2.js (L82-L92)
2020-01-08 11:56:10 +01:00

18 lines
276 B
Plaintext

{
"extends": [
"../.eslintrc"
],
"rules": {
// Plugins
"import/no-unresolved": ["error", { "ignore": ["pdfjs-lib"]}],
// Stylistic Issues
"no-nested-ternary": "error",
// ECMAScript 6
"no-var": "error",
"prefer-const": "error",
},
}