-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update eslint package and config
using a modified mobile repo .eslintrc ran format / lint on all files for whatever reason the formatter swaps imports/require statements, which the linter (both are eslint) complains about being incorrectly ordered using the simple import sort plugin works correctly for imports and doesn't re-order require statements, so manually ordering as opposed to manually saving without format on save i suspect this may also have to do with my broken vs code update and eslint insider extension
- Loading branch information
1 parent
295e3f4
commit 8ae2010
Showing
17 changed files
with
784 additions
and
1,246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,77 @@ | ||
{ | ||
"extends": "airbnb", | ||
"extends": "airbnb-base", | ||
"root": true, | ||
"env": { | ||
"es6": true, | ||
"mocha": true | ||
}, | ||
"plugins": ["simple-import-sort"], | ||
"rules": { | ||
"array-bracket-spacing": [ | ||
"error", | ||
"always" | ||
], | ||
"arrow-parens": [ | ||
// Spacing in brackets is consistent and readable | ||
"array-bracket-spacing": ["error", "always"], | ||
// Spacing in brackets is consistent and readable | ||
"computed-property-spacing": ["error", "always"], | ||
// Spacing in brackets is consistent and readable | ||
"space-in-parens": [ | ||
"error", | ||
"as-needed", | ||
"always", | ||
{ | ||
"requireForBlockBody": false | ||
"exceptions": ["empty"] | ||
} | ||
], | ||
"computed-property-spacing": [ | ||
// Doesn't really help to check if the module is on the filesystem, and can harm when using Docker etc: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md | ||
"import/no-unresolved": "off", | ||
// Do not require .js/ts extensions, except for .json | ||
"import/extensions": [ | ||
"error", | ||
"always" | ||
], | ||
"func-names": [ | ||
"warn", | ||
"never" | ||
"never", | ||
{ | ||
"json": "always" | ||
} | ||
], | ||
"import/extensions": "off", | ||
"import/no-unresolved": "off", | ||
// Preferable, but the author should know best for the situation | ||
"import/prefer-default-export": "off", | ||
// Windows users may checkout as CRLF, but check in as LF, which this rule breaks | ||
"linebreak-style": "off", | ||
"no-await-in-loop": "off", | ||
"no-loop-func": "off", | ||
"no-restricted-syntax": "off", | ||
"no-shadow": "off", | ||
// There's no need to have more than 1 empty line, ever | ||
"no-multiple-empty-lines": [ | ||
"error", | ||
{ | ||
"max": 1 | ||
} | ||
], | ||
// No unused variables except when prepended with _, to indicate that they're not to be used, but require definition to be valid code | ||
"no-unused-vars": [ | ||
"warn", | ||
"error", | ||
{ | ||
"argsIgnorePattern": "(res|next)" | ||
"ignoreRestSiblings": true, | ||
"argsIgnorePattern": "^_" | ||
} | ||
], | ||
// https://eslint.org/docs/rules/no-shadow seems sensible to not have shadow variables, but can get annoying real quick, especially in the case of reducers | ||
"no-shadow": "off", | ||
// Be consistent about where the object braces go | ||
"object-curly-newline": [ | ||
"error", | ||
{ | ||
"consistent": true | ||
} | ||
], | ||
"react/jsx-filename-extension": "off", | ||
"require-jsdoc": "warn", | ||
"semi": [ | ||
"error", | ||
"never" | ||
], | ||
"semi-style": [ | ||
// Object properties either on the same line, or all on separate, consistently | ||
"object-property-newline": [ | ||
"error", | ||
"first" | ||
{ | ||
"allowAllPropertiesOnSameLine": true | ||
} | ||
], | ||
"space-in-parens": [ | ||
"error", | ||
"always" | ||
] | ||
// Semi colons are visual garbage | ||
"semi": ["error", "never"], | ||
// For the few semi-colons required (e.g. inline array operations), place them at the beginning of the statement | ||
"semi-style": ["error", "first"], | ||
// This plugin sorts alphabetically by default | ||
"simple-import-sort/sort": "error", | ||
// Add new line between imports | ||
"import/order": "off", | ||
"sort-imports": "off" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const escapeStringRegexp = require( 'escape-string-regexp' ) | ||
|
||
const getRegexClass = characters => `[${characters.map( escapeStringRegexp ).join( '' )}]` | ||
const getRegexClass = ( characters ) => `[${characters.map( escapeStringRegexp ).join( '' )}]` | ||
|
||
const getRegexGroup = characters => `(${characters.map( escapeStringRegexp ).join( '|' )})` | ||
const getRegexGroup = ( characters ) => `(${characters.map( escapeStringRegexp ).join( '|' )})` | ||
|
||
module.exports = { getRegexClass, getRegexGroup } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.