Skip to content
This repository was archived by the owner on Jun 16, 2021. It is now read-only.

Commit c81029c

Browse files
committed
style: 💄 space-before-function-paren (p) trailingComma (e)
```bash ▲ git-cz [feature/prettier-update] yarn lint yarn run v1.22.5 $ yarn lint:prettier --check && yarn lint:eslint $ prettier "**/*.{js,jsx,ts,tsx,json,md,mdx,css,html,yml,yaml,scss}" --check Checking formatting... All matched files use Prettier code style! $ eslint . --ext js,jsx,ts,tsx --max-warnings=0 ✨ Done in 4.00s. ```
1 parent 0231a55 commit c81029c

File tree

10 files changed

+22
-14
lines changed

10 files changed

+22
-14
lines changed

‎.eslintrc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,14 @@ module.exports = {
487487

488488
// @question this contradicts prettier
489489
// 'space-before-function-paren': [2, 'always'],
490-
'space-before-function-paren': [2, 'never'],
490+
'space-before-function-paren': [
491+
2,
492+
{
493+
anonymous: 'always',
494+
asyncArrow: 'always',
495+
named: 'never',
496+
},
497+
],
491498

492499
'space-in-parens': [2, 'never'],
493500
'space-infix-ops': 2,

‎.prettierrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable filenames/match-regex */
12
module.exports = {
23
arrowParens: 'always',
34
bracketSpacing: false,
@@ -6,5 +7,5 @@ module.exports = {
67
semi: true,
78
singleQuote: true,
89
tabWidth: 2,
9-
trailingComma: 'es5',
10+
trailingComma: 'all',
1011
};

‎lib/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const executeCommand = (command, env = process.env) => {
2525
};
2626

2727
// eslint-disable-next-line complexity
28-
const main = async() => {
28+
const main = async () => {
2929
try {
3030
const {cliAnswers, cliOptions, passThroughParams} = parseArgs();
3131

‎lib/cz.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const runInteractiveQuestions = require('./runInteractiveQuestions');
33
const formatCommitMessage = require('./formatCommitMessage');
44

55
exports.prompter = (cz, commit) => {
6-
const run = async() => {
6+
const run = async () => {
77
const state = createState();
88

99
await runInteractiveQuestions(state);

‎lib/formatCommitMessage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const wrap = require('word-wrap');
44

55
const MAX_LINE_WIDTH = 72;
66

7-
const makeAffectsLine = function(answers) {
7+
const makeAffectsLine = function (answers) {
88
const selectedPackages = answers.packages;
99

1010
if (selectedPackages && selectedPackages.length) {

‎lib/questions/scope.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const fuzzy = require('fuzzy');
66
* @param {string} substring Substring to search with.
77
* @param {string[]} scopes Scopes list.
88
*/
9-
const findScope = function(substring, scopes) {
9+
const findScope = function (substring, scopes) {
1010
return Promise.resolve(
1111
fuzzy.filter(substring || '', scopes).map(({original: scope}) => scope),
1212
);

‎lib/questions/type.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const typeToListItem = ({types, disableEmoji}, type) => {
1616
* @param {string} substring Substring to search with.
1717
* @param {string[]} config The whole config.
1818
*/
19-
const findType = function(substring, config) {
19+
const findType = function (substring, config) {
2020
const types = config.list;
2121

2222
return Promise.resolve(
@@ -29,7 +29,7 @@ const findType = function(substring, config) {
2929
exports.createQuestion = (state) => {
3030
const {config} = state;
3131
const question = {
32-
message: 'Select the type of change that you\'re committing:',
32+
message: 'Select the type of change that you’re committing:',
3333
name: 'type',
3434
source: (_answers, input) => findType(input, config),
3535
type: 'autocomplete',

‎lib/runInteractiveQuestions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inquirer.registerPrompt('autocomplete', AutocompletePrompt);
1313
// promptQuestions = promptQuestions.concat(createPackagesQuestion(allPackages, changedPackages));
1414
// }
1515

16-
const runInteractiveQuestions = async(state, cliAnswers) => {
16+
const runInteractiveQuestions = async (state, cliAnswers) => {
1717
Object.keys(cliAnswers).forEach((key) => {
1818
state.answers[key] = cliAnswers[key];
1919
});

‎test/cli.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
const pkg = require('../package.json');
22
const {runCLI} = require('./testUtils');
33

4-
test('git-cz --help', async() => {
4+
test('git-cz --help', async () => {
55
const {getResult} = runCLI(['--help']);
66

77
const result = await getResult();
88

99
expect(result).toMatchSnapshot();
1010
});
1111

12-
test('git-cz --version', async() => {
12+
test('git-cz --version', async () => {
1313
const {getResult} = runCLI(['--version']);
1414

1515
const result = await getResult();
1616

1717
expect(result.trim()).toBe(pkg.version);
1818
});
1919

20-
test('git-cz --non-interactive', async() => {
20+
test('git-cz --non-interactive', async () => {
2121
const {getResult} = runCLI(['--non-interactive', '--dry-run']);
2222

2323
const result = await getResult();

‎test/testUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ exports.runCLI = (args = []) => {
1212

1313
const {promise, stdin} = spawn('node', [CLI_PATH, ...args]);
1414

15-
const getResult = async() => {
15+
const getResult = async () => {
1616
const {stdout} = await promise;
1717

1818
return stdout;
1919
};
2020

2121
const delay = () => new Promise((resolve) => setTimeout(resolve, 500));
2222

23-
const write = async(inputs = []) => {
23+
const write = async (inputs = []) => {
2424
for (const input of inputs) {
2525
stdin.write(input);
2626
await delay();

0 commit comments

Comments
 (0)