Skip to content

Commit 7a7d2ac

Browse files
committed
Merge updates from project template
Including updated ESLint version and config. Fixes: #37 Fixes: #40 Signed-off-by: Kevin Locke <[email protected]>
2 parents 2107dd9 + c883cf7 commit 7a7d2ac

File tree

3 files changed

+327
-179
lines changed

3 files changed

+327
-179
lines changed

.eslintrc.json

Lines changed: 1 addition & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,8 @@
11
// ESLint configuration <https://eslint.org/docs/user-guide/configuring>
22
{
3-
// Based on Airbnb with changes to match Node core and my prefs.
4-
"extends": "airbnb-base",
5-
6-
"parserOptions": {
7-
"sourceType": "script"
8-
},
3+
"extends": "@kevinoid/eslint-config/node.js",
94

105
"rules": {
11-
//// Possible Errors <https://eslint.org/docs/rules/#possible-errors>
12-
// disallow trailing commas in array and object literals
13-
"comma-dangle": ["error", "never"],
14-
15-
//// Best Practices <https://eslint.org/docs/rules/#best-practices>
16-
// require curly braces around all control statements, not just multi-line.
17-
"curly": ["error", "all"],
18-
// disallow unnecessary parentheses
19-
"no-extra-parens": ["error", "all", {
20-
"conditionalAssign": false,
21-
"enforceForArrowConditionals": false,
22-
"nestedBinaryExpressions": false,
23-
"returnAssign": false
24-
}],
25-
// allow multiple spaces only before EOL (for inline comment alignment)
26-
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
27-
// allow reassignment of function parameters
28-
// simplicity for optional arguments outweighs the perf advantage, usually
29-
"no-param-reassign": "off",
30-
// disallow unnecessary use of Function.prototype.{apply,call}
31-
"no-useless-call": "error",
32-
// Disallow unnecessary catch clauses
33-
"no-useless-catch": "error",
34-
35-
//// Strict Mode <https://eslint.org/docs/rules/#strict-mode>
36-
// require 'use strict' in global scope
37-
"strict": ["error", "global"],
38-
39-
//// Variables <https://eslint.org/docs/rules/#variables>
40-
// disallow shadowing of variables (including builtins and hoisted funcs)
41-
"no-shadow": ["error", { "builtinGlobals": true, "hoist": "all" }],
42-
// disallow declaration of variables that are not used in the code
43-
// allow unused args for documentation, future use, and correct .length
44-
"no-unused-vars": ["error", {"args": "none"}],
45-
// disallow referencing variables before declaring them, excluding functions
46-
// since it is required for mutually-recursive functions
47-
"no-use-before-define": ["error", "nofunc"],
48-
49-
//// Stylistic Issues <https://eslint.org/docs/rules/#stylistic-issues>
50-
// require camel case names (even for properties and destructuring)
51-
"camelcase": ["error", {
52-
"ignoreDestructuring": false
53-
}],
54-
// allow unnamed functions
55-
"func-names": "off",
56-
// don't enforce consistent linebreak style
57-
// Allow developers to develop with native EOL. VCS manages committed style.
58-
"linebreak-style": "off",
59-
// enforce a maximum line length
60-
// reduce from 100 to 80 chars (conventional terminal width)
61-
// ignore lines which consist of a single string, URL, or RegExp literal,
62-
// possibly prefixed with comment opener or suffixed with ";".
63-
// (Not ESLint ignore props which ignores any lines which contain these.)
64-
"max-len": ["error", 80, 2, {
65-
"ignorePattern": "^\\s*((/?\\*|/[/])\\s*)?('[^'\\\\]*(\\\\.[^'\\\\]*)*'|\"[^\"\\\\]*(\\\\.[^\"\\\\]*)*\"|/[^/\\\\]*(\\\\.[^/\\\\]*)*/[gimuy]*|[^:/?#\\s]+:/[/]\\S+);?$"
66-
}],
67-
// allow nested ternary expressions
68-
// if they are indented one-expression-per-line, they are clear enough for me
69-
"no-nested-ternary": "off",
70-
// disallow process.exit()
71-
// this is disabled locally only when require.main === module
72-
"no-process-exit": "error",
73-
// disallow extra spaces in object literals
74-
"object-curly-spacing": ["error", "never"],
75-
// allow multiple variable declarations per block/function and multiple
76-
// declarators per declaration
77-
"one-var": "off",
78-
// require initialized variables to be declared on separate lines
79-
"one-var-declaration-per-line": ["error", "initializations"],
80-
// Requires operator at the beginning of the line in multiline statements
81-
// Airbnb prevents breaks around =, suggesting (). I don't see the advantage.
82-
// Break after = looks better to me, so first assigned operand is farther left.
83-
"operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }],
84-
// space before function parens only for async arrow (as Node core does)
85-
"space-before-function-paren": ["error", {
86-
"anonymous": "never",
87-
"named": "never",
88-
"asyncArrow": "always"
89-
}],
90-
91-
//// ECMAScript 6 Rules <https://eslint.org/docs/rules/#ecmascript-6>
92-
// require parentheses around arrow function arguments (as Node core does)
93-
"arrow-parens": ["error", "always"],
94-
95-
// eslint-plugin-import
966
// Allow requiring devDependencies for build and test
977
"import/no-extraneous-dependencies": ["error", {
988
"devDependencies": [

0 commit comments

Comments
 (0)