Skip to content

Commit 37e4f3a

Browse files
committed
Update linter and fix new linting errors
1 parent 8887667 commit 37e4f3a

File tree

5 files changed

+124
-73
lines changed

5 files changed

+124
-73
lines changed

.eslintrc-md.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"extends": ".eslintrc",
44
"rules": {
55
"quotes": [2, "single", { "avoidEscape": true }],
6-
"import/extensions": false,
7-
"import/no-extraneous-dependencies": false,
8-
"import/no-unresolved": false
6+
"import/extensions": "off",
7+
"import/no-extraneous-dependencies": "off",
8+
"import/no-unresolved": "off"
99
}
1010
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
"prepublishOnly": "yarn run lint && yarn test && yarn run build"
2929
},
3030
"devDependencies": {
31-
"@avalanche/eslint-config": "^3.0.0",
31+
"@avalanche/eslint-config": "^4.0.0",
3232
"@babel/core": "^7.5.5",
3333
"@babel/preset-env": "^7.5.5",
3434
"@vue/test-utils": "1.0.0-beta.29",
3535
"babel-core": "^7.0.0-bridge.0",
3636
"babel-jest": "^24.9.0",
3737
"coveralls": "^3.0.6",
38-
"eslint": "^5.16.0",
39-
"eslint-plugin-compat": "^3.1.2",
40-
"eslint-plugin-import": "^2.17.3",
38+
"eslint": "^6.2.1",
39+
"eslint-plugin-compat": "^3.3.0",
40+
"eslint-plugin-import": "^2.18.2",
4141
"eslint-plugin-markdown": "^1.0.0",
4242
"jest": "^24.9.0",
4343
"rollup": "^1.19.4",

src/index.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import arrayToObject from './lib/array-to-object';
33
function normalizeNamespace(fn) {
44
return (...params) => {
55
// eslint-disable-next-line prefer-const
6-
let [namespace, map, getterType, mutationType] =
7-
typeof params[0] === `string` ? [...params] : [``, ...params];
6+
let [namespace, map, getterType, mutationType] = typeof params[0] === `string`
7+
? [...params]
8+
: [``, ...params];
89

910
if (namespace.length && namespace.charAt(namespace.length - 1) !== `/`) {
1011
namespace += `/`;
@@ -70,8 +71,8 @@ export const mapMultiRowFields = normalizeNamespace((
7071
const store = this.$store;
7172
const rows = store.getters[getterType](path);
7273

73-
return rows.map((fieldsObject, index) =>
74-
Object.keys(fieldsObject).reduce((prev, fieldKey) => {
74+
return rows
75+
.map((fieldsObject, index) => Object.keys(fieldsObject).reduce((prev, fieldKey) => {
7576
const fieldPath = `${path}[${index}].${fieldKey}`;
7677

7778
return Object.defineProperty(prev, fieldKey, {
@@ -93,8 +94,16 @@ export const mapMultiRowFields = normalizeNamespace((
9394
export const createHelpers = ({ getterType, mutationType }) => ({
9495
[getterType]: getField,
9596
[mutationType]: updateField,
96-
mapFields: normalizeNamespace((namespace, fields) =>
97-
mapFields(namespace, fields, getterType, mutationType)),
98-
mapMultiRowFields: normalizeNamespace((namespace, paths) =>
99-
mapMultiRowFields(namespace, paths, getterType, mutationType)),
97+
mapFields: normalizeNamespace((namespace, fields) => mapFields(
98+
namespace,
99+
fields,
100+
getterType,
101+
mutationType,
102+
)),
103+
mapMultiRowFields: normalizeNamespace((namespace, paths) => mapMultiRowFields(
104+
namespace,
105+
paths,
106+
getterType,
107+
mutationType,
108+
)),
100109
});

src/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
mapFields,
55
mapMultiRowFields,
66
updateField,
7-
} from './';
7+
} from '.';
88

99
describe(`index`, () => {
1010
describe(`getField()`, () => {

0 commit comments

Comments
 (0)