mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
275 lines
6.2 KiB
YAML
275 lines
6.2 KiB
YAML
env:
|
|
node: true
|
|
|
|
#
|
|
# 0 - disable
|
|
# Rules that more harmful than useful, or just buggy.
|
|
#
|
|
# 1 - warning
|
|
# Rules that we didn't encounter yet. You can safely ignore them,
|
|
# but I'd like to know any interesting use-cases they forbid.
|
|
#
|
|
# 2 - error
|
|
# Rules that have proven to be useful, please follow them.
|
|
#
|
|
|
|
rules:
|
|
# didn't understand what it does, but it fails a good code
|
|
block-scoped-var: 0
|
|
|
|
# fails where newlines are used to format pretty big "if":
|
|
# if (
|
|
# name.charAt(0) === "." ||
|
|
# name.match(/[\/@\s\+%:]/) ||
|
|
# name !== encodeURIComponent(name) ||
|
|
# name.toLowerCase() === "node_modules"
|
|
# ) {
|
|
brace-style: 1
|
|
|
|
# snake_case is more readable, what's up with you guys?
|
|
camelcase: 0
|
|
|
|
# if some functions are complex, they are for a good reason,
|
|
# ain't worth it
|
|
complexity: [0, 10]
|
|
|
|
# never saw it, but self is preferred
|
|
consistent-this: [1, self]
|
|
|
|
# fails good code
|
|
curly: [0, multi]
|
|
|
|
# fails good code, where this notation is used for consistency:
|
|
# something['foo-bar'] = 123
|
|
# something['blahblah'] = 234
|
|
dot-notation: 0
|
|
|
|
# pointless in many cases (like indexOf() == -1), harmful in a few
|
|
# cases (when you do want to ignore types), fails good code
|
|
eqeqeq: 0
|
|
|
|
# if someone is changing prototype and makes properties enumerable,
|
|
# it's their own fault
|
|
guard-for-in: 0
|
|
|
|
# if some functions are complex, they are for a good reason,
|
|
# ain't worth it
|
|
max-depth: [0, 4]
|
|
max-nested-callbacks: [0, 2]
|
|
|
|
# should it really throw for every long URL?
|
|
max-len: [0, 80, 4]
|
|
|
|
# that's obvious by just looking at the code, you don't need lint for that
|
|
max-params: [0, 3]
|
|
|
|
# if some functions are complex, they are for a good reason,
|
|
# ain't worth it
|
|
max-statements: [0, 10]
|
|
|
|
# that one makes sense
|
|
new-cap: 2
|
|
|
|
# I'm writing javascript, not some weird reduced version of it
|
|
no-bitwise: 0
|
|
|
|
# not working around IE bugs, sorry
|
|
no-catch-shadow: 0
|
|
|
|
# see above, IE is useful for downloading other browsers only
|
|
no-comma-dangle: 0
|
|
|
|
# good for removing debugging code
|
|
no-console: 2
|
|
|
|
# good for removing debugging code
|
|
no-debugger: 2
|
|
|
|
# why would anyone need to check against that?
|
|
no-else-return: 0
|
|
|
|
# sometimes empty statement contains useful comment
|
|
no-empty: 0
|
|
|
|
# stupid rule
|
|
# "x == null" is "x === null || x === undefined"
|
|
no-eq-null: 0
|
|
|
|
# fails good code, when parens are used for grouping:
|
|
# (req && req.headers['via']) ? req.headers['via'] + ', ' : ''
|
|
# not everyone remembers priority tables, you know
|
|
no-extra-parens: 0
|
|
|
|
# fails defensive semicolons:
|
|
# ;['foo', 'bar'].forEach(function(x) {})
|
|
no-extra-semi: 0
|
|
|
|
# fails good code:
|
|
# var fs = require('fs'),
|
|
# , open = fs.open
|
|
no-mixed-requires: [0, false]
|
|
|
|
# new Array(12) is used to pre-allocate arrays
|
|
no-new-array: 0
|
|
|
|
# fails good code:
|
|
# fs.open('/file', 0666, function(){})
|
|
no-octal: 0
|
|
|
|
# fails good code:
|
|
# console.log('\033[31m' + str + '\033[39m')
|
|
# also fails \0 which is not octal escape
|
|
no-octal-escape: 0
|
|
|
|
# I'm writing javascript, not some weird reduced version of it
|
|
no-plusplus: 0
|
|
|
|
# fails good code:
|
|
# if (a) {
|
|
# var x = 'foo'
|
|
# } else {
|
|
# var x = bar
|
|
# }
|
|
no-redeclare: 0
|
|
|
|
# sometimes useful, often isn't
|
|
# probably worth enforcing
|
|
no-shadow: 2
|
|
|
|
no-sync: 2
|
|
|
|
# I'm writing javascript, not some weird reduced version of it
|
|
no-ternary: 0
|
|
|
|
# the single most important rule in the entire ruleset
|
|
no-undef: 2
|
|
|
|
# it is failing our own underscores
|
|
no-underscore-dangle: 0
|
|
|
|
# fails function hoisting
|
|
no-unreachable: 0
|
|
|
|
# fails npm-style code, it's good once you get used to it:
|
|
# if (typeof(options) === 'function') callback = options, options = {}
|
|
no-unused-expressions: 0
|
|
|
|
# fails (function(_err) {}) where named argument is used to show what
|
|
# nth function argument means
|
|
no-unused-vars: [0, local]
|
|
|
|
# fails function hoisting
|
|
no-use-before-define: 0
|
|
|
|
# fails foobar( (function(){}).bind(this) )
|
|
# parens are added for readability
|
|
no-wrap-func: 0
|
|
|
|
# fails good code:
|
|
# var x
|
|
# if (something) {
|
|
# var y
|
|
one-var: 0
|
|
|
|
quote-props: 0
|
|
|
|
# fails situation when different quotes are used to avoid escaping
|
|
quotes: [2, single, avoid-escape]
|
|
|
|
# http:#blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding
|
|
semi: [2, never]
|
|
|
|
# fails good code where spaces are used for grouping:
|
|
# (x+y * y+z)
|
|
space-infix-ops: 0
|
|
|
|
# typeof(something) should have braces to look like a function
|
|
# a matter of taste I suppose
|
|
space-unary-word-ops: 0
|
|
|
|
# strict mode is just harmful,
|
|
# can I have a check to enforce not using it?
|
|
strict: 0
|
|
|
|
sort-vars: 0
|
|
no-path-concat: 0
|
|
func-names: 0
|
|
|
|
# how can you set a return code without process.exit?
|
|
no-process-exit: 0
|
|
|
|
# both styles are useful
|
|
func-style: [0, declaration]
|
|
|
|
# fails while(1) {...}
|
|
no-constant-condition: 0
|
|
|
|
# fails good code:
|
|
# https://github.com/rlidwka/jju/blob/eb52ee72e5f21d48963798f9bda8ac8d68082148/lib/parse.js#L732
|
|
no-ex-assign: 0
|
|
|
|
wrap-iife: [2, inside]
|
|
|
|
# doesn't always make sense
|
|
consistent-return: 0
|
|
no-sequences: 0
|
|
|
|
# fails defensive semicolons
|
|
no-space-before-semi: 0
|
|
|
|
new-parens: 1
|
|
no-alert: 1
|
|
no-array-constructor: 1
|
|
no-caller: 1
|
|
no-cond-assign: 1
|
|
no-control-regex: 1
|
|
no-delete-var: 1
|
|
no-div-regex: 1
|
|
no-dupe-keys: 1
|
|
no-empty-class: 1
|
|
no-empty-label: 1
|
|
no-eval: 1
|
|
no-extend-native: 1
|
|
no-extra-boolean-cast: 1
|
|
no-extra-strict: 1
|
|
no-fallthrough: 1
|
|
no-floating-decimal: 1
|
|
no-func-assign: 1
|
|
no-global-strict: 1
|
|
no-implied-eval: 1
|
|
no-invalid-regexp: 1
|
|
no-iterator: 1
|
|
no-labels: 1
|
|
no-label-var: 1
|
|
no-lone-blocks: 1
|
|
no-loop-func: 1
|
|
no-multi-str: 1
|
|
no-native-reassign: 1
|
|
no-negated-in-lhs: 1
|
|
no-nested-ternary: 1
|
|
no-new: 1
|
|
no-new-func: 1
|
|
no-new-object: 1
|
|
no-new-wrappers: 1
|
|
no-obj-calls: 1
|
|
no-octal: 1
|
|
no-proto: 1
|
|
no-regex-spaces: 1
|
|
no-return-assign: 1
|
|
no-script-url: 1
|
|
no-self-compare: 1
|
|
no-shadow: 1
|
|
no-shadow-restricted-names: 1
|
|
no-spaced-func: 1
|
|
no-sparse-arrays: 1
|
|
no-sync: 1
|
|
no-undef: 1
|
|
no-undef-init: 1
|
|
no-unreachable: 1
|
|
no-with: 1
|
|
no-yoda: 1
|
|
radix: 1
|
|
space-return-throw-case: 1
|
|
use-isnan: 1
|
|
valid-jsdoc: 1
|
|
wrap-regex: 1
|