Skip to content

Commit 2806171

Browse files
committed
Update prettier
1 parent 2e32936 commit 2806171

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

lib/rules/no-absolute-imports.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ module.exports.meta = {
1515
schema: [],
1616
};
1717

18-
module.exports.create = context =>
18+
module.exports.create = (context) =>
1919
getImport(context, ({ node, path, start, end }) => {
2020
packages.forEach(({ name, location }) => {
2121
if (isSubPath(location, context.getFilename()) && isSubPath(name, path)) {
2222
context.report({
2323
node,
2424
message:
2525
'Absolute imports within the current package are not allowed',
26-
fix: fixer =>
26+
fix: (fixer) =>
2727
fixer.replaceTextRange(
2828
[start + 1, end - 1],
2929
pathToImport(

lib/rules/no-cross-imports.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports.meta = {
3131
],
3232
};
3333

34-
module.exports.create = context => {
34+
module.exports.create = (context) => {
3535
const {
3636
options: [{ allow = [] } = {}],
3737
} = context;

lib/rules/no-relative-imports.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ module.exports.meta = {
1414
schema: [],
1515
};
1616

17-
module.exports.create = context =>
17+
module.exports.create = (context) =>
1818
getImport(context, ({ node, path, start, end, currentPackage }) => {
1919
packages.forEach(({ name, location }) => {
2020
if (name !== currentPackage.name && isSubPath(location, path)) {
2121
context.report({
2222
node,
2323
message: 'Relative imports of other packages are not allowed',
24-
fix: fixer =>
24+
fix: (fixer) =>
2525
fixer.replaceTextRange(
2626
[start + 1, end - 1],
2727
path.replace(location, name),

lib/rules/require-dependency.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports.meta = {
1313
schema: [],
1414
};
1515

16-
module.exports.create = context =>
16+
module.exports.create = (context) =>
1717
getImport(context, ({ node, value, path, currentPackage }) => {
1818
packages.forEach(({ name, location }) => {
1919
const { dependencies, devDependencies } = currentPackage;

lib/utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const resolveImport = (context, node, { value, range }, currentPackage) => {
3232
return { node, value, path, start, end, currentPackage };
3333
};
3434

35-
const pathToImport = path => {
35+
const pathToImport = (path) => {
3636
if (path === '') return '.';
3737

3838
const normalized = normalize(path).replace(/\\/g, '/');
@@ -42,7 +42,7 @@ const pathToImport = path => {
4242
return normalized;
4343
};
4444

45-
const findCurrentPackage = context =>
45+
const findCurrentPackage = (context) =>
4646
packages.find(({ location }) => isSubPath(location, context.getFilename()));
4747

4848
const getImport = (context, callback) => {
@@ -51,10 +51,10 @@ const getImport = (context, callback) => {
5151
if (!currentPackage) return {};
5252

5353
return {
54-
ImportDeclaration: node => {
54+
ImportDeclaration: (node) => {
5555
callback(resolveImport(context, node, node.source, currentPackage));
5656
},
57-
CallExpression: node => {
57+
CallExpression: (node) => {
5858
if (
5959
node.arguments.length > 0 &&
6060
node.arguments[0].type === 'Literal' &&
@@ -66,7 +66,7 @@ const getImport = (context, callback) => {
6666
);
6767
}
6868
},
69-
ImportExpression: node => {
69+
ImportExpression: (node) => {
7070
callback(resolveImport(context, node, node.source, currentPackage));
7171
},
7272
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
"mocha": "^7.1.0",
5050
"mock-require": "^3.0.3",
5151
"nyc": "^15.0.0",
52-
"prettier": "^1.19.1"
52+
"prettier": "^2.0.5"
5353
}
5454
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,10 +1823,10 @@ prettier-linter-helpers@^1.0.0:
18231823
dependencies:
18241824
fast-diff "^1.1.2"
18251825

1826-
prettier@^1.19.1:
1827-
version "1.19.1"
1828-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
1829-
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
1826+
prettier@^2.0.5:
1827+
version "2.0.5"
1828+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
1829+
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
18301830

18311831
process-on-spawn@^1.0.0:
18321832
version "1.0.0"

0 commit comments

Comments
 (0)