Skip to content

Commit 5fd27fd

Browse files
escapedcatrenovate-botbyCedric
authored
Chore/prettier 2.x (conventional-changelog#2025)
* chore: update dependency prettier to v2 * chore: update prettier to v2.x * chore: apply prettier v2.x format fixes * chore: only run all circle-ci tasks on node LTS * fix: run prettier fixes from docker (conventional-changelog#2027) Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Cedric van Putten <[email protected]>
1 parent 44144ca commit 5fd27fd

File tree

139 files changed

+705
-715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+705
-715
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
docker:
9191
- image: node:14
9292
steps:
93-
- run-all
93+
- run-tests
9494
windows-v12:
9595
executor: win/default
9696
steps:

.eslintrc.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ module.exports = {
33
plugins: ['@typescript-eslint', 'jest', 'import'],
44
env: {
55
es6: true,
6-
node: true
6+
node: true,
77
},
88
parserOptions: {
99
sourceType: 'module',
1010
ecmaVersion: 11,
1111
ecmaFeatures: {
12-
jsx: false
13-
}
12+
jsx: false,
13+
},
1414
},
1515
extends: ['eslint:recommended', 'prettier'],
1616
rules: {
@@ -25,7 +25,7 @@ module.exports = {
2525
// Prevent importing the default as if it were named
2626
'import/no-named-default': 'error',
2727
// Forbid a module from importing itself
28-
'import/no-self-import': 'error'
28+
'import/no-self-import': 'error',
2929

3030
// Enable after https://github.com/benmosher/eslint-plugin-import/issues/1650 is fixed
3131
// Forbid the use of extraneous packages
@@ -41,7 +41,7 @@ module.exports = {
4141
extends: [
4242
'plugin:@typescript-eslint/eslint-recommended',
4343
'plugin:@typescript-eslint/recommended',
44-
'prettier/@typescript-eslint'
44+
'prettier/@typescript-eslint',
4545
],
4646
rules: {
4747
'@typescript-eslint/no-unused-vars': 'off',
@@ -54,21 +54,21 @@ module.exports = {
5454

5555
// TODO: enable those rules?
5656
'no-empty': 'off',
57-
'no-var': 'off'
58-
}
57+
'no-var': 'off',
58+
},
5959
},
6060
{
6161
files: ['*.test.ts', '*.test.js'],
6262
env: {
63-
jest: true
63+
jest: true,
6464
},
6565
extends: ['plugin:jest/recommended'],
6666
rules: {
6767
'@typescript-eslint/no-explicit-any': 'off',
6868
'@typescript-eslint/no-var-requires': 'off',
6969
// disallow non-import statements appearing before import statements
70-
'import/first': 'off'
71-
}
72-
}
73-
]
70+
'import/first': 'off',
71+
},
72+
},
73+
],
7474
};

@alias/commitlint/cli.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ function cli(args, options, input) {
77
const c = execa(bin, args, {
88
cwd: options.cwd,
99
env: options.env,
10-
input: input
10+
input: input,
1111
});
12-
return c.catch(err => err);
12+
return c.catch((err) => err);
1313
}
1414

15-
const fixBootstrap = fixture => fix.bootstrap(fixture, __dirname);
15+
const fixBootstrap = (fixture) => fix.bootstrap(fixture, __dirname);
1616

1717
test('should reprint input from stdin', async () => {
1818
const cwd = await fixBootstrap('fixtures/default');

@commitlint/cli/src/cli.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const cli = (args: string[], options: TestOptions) => {
1717
cwd: options.cwd,
1818
env: options.env,
1919
input: input,
20-
reject: false
20+
reject: false,
2121
});
2222
};
2323
};
@@ -239,7 +239,7 @@ test('should allow reading of environment variables for edit file, succeeding if
239239
await fs.writeFile(path.join(cwd, 'commit-msg-file'), 'foo');
240240
const actual = await cli(['--env', 'variable'], {
241241
cwd,
242-
env: {variable: 'commit-msg-file'}
242+
env: {variable: 'commit-msg-file'},
243243
})();
244244
expect(actual.exitCode).toBe(0);
245245
});
@@ -252,7 +252,7 @@ test('should allow reading of environment variables for edit file, failing if in
252252
);
253253
const actual = await cli(['--env', 'variable'], {
254254
cwd,
255-
env: {variable: 'commit-msg-file'}
255+
env: {variable: 'commit-msg-file'},
256256
})();
257257
expect(actual.exitCode).toBe(1);
258258
});

@commitlint/cli/src/cli.ts

+29-33
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
ParserOptions,
1515
ParserPreset,
1616
QualifiedConfig,
17-
Formatter
17+
Formatter,
1818
} from '@commitlint/types';
1919
import {CliError} from './cli-error';
2020

@@ -26,77 +26,77 @@ const cli = yargs
2626
alias: 'c',
2727
default: true,
2828
description: 'toggle colored output',
29-
type: 'boolean'
29+
type: 'boolean',
3030
},
3131
config: {
3232
alias: 'g',
3333
description: 'path to the config file',
34-
type: 'string'
34+
type: 'string',
3535
},
3636
cwd: {
3737
alias: 'd',
3838
default: process.cwd(),
3939
defaultDescription: '(Working Directory)',
4040
description: 'directory to execute in',
41-
type: 'string'
41+
type: 'string',
4242
},
4343
edit: {
4444
alias: 'e',
4545
default: false,
4646
description:
4747
'read last commit message from the specified file or fallbacks to ./.git/COMMIT_EDITMSG',
48-
type: 'string'
48+
type: 'string',
4949
},
5050
env: {
5151
alias: 'E',
5252
description:
5353
'check message in the file at path given by environment variable value',
54-
type: 'string'
54+
type: 'string',
5555
},
5656
extends: {
5757
alias: 'x',
5858
description: 'array of shareable configurations to extend',
59-
type: 'array'
59+
type: 'array',
6060
},
6161
'help-url': {
6262
alias: 'H',
6363
type: 'string',
64-
description: 'help url in error message'
64+
description: 'help url in error message',
6565
},
6666
from: {
6767
alias: 'f',
6868
description:
6969
'lower end of the commit range to lint; applies if edit=false',
70-
type: 'string'
70+
type: 'string',
7171
},
7272
format: {
7373
alias: 'o',
7474
description: 'output format of the results',
75-
type: 'string'
75+
type: 'string',
7676
},
7777
'parser-preset': {
7878
alias: 'p',
7979
description:
8080
'configuration preset to use for conventional-commits-parser',
81-
type: 'string'
81+
type: 'string',
8282
},
8383
quiet: {
8484
alias: 'q',
8585
default: false,
8686
description: 'toggle console output',
87-
type: 'boolean'
87+
type: 'boolean',
8888
},
8989
to: {
9090
alias: 't',
9191
description:
9292
'upper end of the commit range to lint; applies if edit=false',
93-
type: 'string'
93+
type: 'string',
9494
},
9595
verbose: {
9696
alias: 'V',
9797
type: 'boolean',
98-
description: 'enable verbose output for reports without problems'
99-
}
98+
description: 'enable verbose output for reports without problems',
99+
},
100100
})
101101
.version(
102102
'version',
@@ -112,7 +112,7 @@ const cli = yargs
112112
)
113113
.strict();
114114

115-
main(cli.argv).catch(err => {
115+
main(cli.argv).catch((err) => {
116116
setTimeout(() => {
117117
if (err.type === pkg.name) {
118118
process.exit(1);
@@ -132,12 +132,12 @@ async function main(options: CliFlags) {
132132
to: flags.to,
133133
from: flags.from,
134134
edit: flags.edit,
135-
cwd: flags.cwd
135+
cwd: flags.cwd,
136136
}));
137137

138138
const messages = (Array.isArray(input) ? input : [input])
139-
.filter(message => typeof message === 'string')
140-
.filter(message => message.trim() !== '')
139+
.filter((message) => typeof message === 'string')
140+
.filter((message) => message.trim() !== '')
141141
.filter(Boolean);
142142

143143
if (messages.length === 0 && !checkFromRepository(flags)) {
@@ -157,7 +157,7 @@ async function main(options: CliFlags) {
157157
parserOpts: {},
158158
plugins: {},
159159
ignores: [],
160-
defaultIgnores: true
160+
defaultIgnores: true,
161161
};
162162
if (parserOpts) {
163163
opts.parserOpts = parserOpts;
@@ -179,7 +179,7 @@ async function main(options: CliFlags) {
179179
}
180180

181181
const results = await Promise.all(
182-
messages.map(message => lint(message, loaded.rules, opts))
182+
messages.map((message) => lint(message, loaded.rules, opts))
183183
);
184184

185185
if (Object.keys(loaded.rules).length === 0) {
@@ -199,12 +199,12 @@ async function main(options: CliFlags) {
199199
message: [
200200
'Please add rules to your `commitlint.config.js`',
201201
' - Getting started guide: https://git.io/fhHij',
202-
' - Example config: https://git.io/fhHip'
203-
].join('\n')
204-
}
202+
' - Example config: https://git.io/fhHip',
203+
].join('\n'),
204+
},
205205
],
206206
warnings: [],
207-
input
207+
input,
208208
});
209209
}
210210

@@ -226,7 +226,7 @@ async function main(options: CliFlags) {
226226
valid: true,
227227
errorCount: 0,
228228
warningCount: 0,
229-
results: []
229+
results: [],
230230
}
231231
);
232232

@@ -235,7 +235,7 @@ async function main(options: CliFlags) {
235235
verbose: flags.verbose,
236236
helpUrl: flags['help-url']
237237
? flags['help-url'].trim()
238-
: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint'
238+
: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint',
239239
});
240240

241241
if (!flags.quiet && output !== '') {
@@ -267,19 +267,15 @@ function normalizeFlags(flags: CliFlags): CliFlags {
267267
const edit = getEditValue(flags);
268268
return {
269269
...flags,
270-
edit
270+
edit,
271271
};
272272
}
273273

274274
function getEditValue(flags: CliFlags) {
275275
if (flags.env) {
276276
if (!(flags.env in process.env)) {
277277
throw new Error(
278-
`Recieved '${
279-
flags.env
280-
}' as value for -E | --env, but environment variable '${
281-
flags.env
282-
}' is not available globally`
278+
`Recieved '${flags.env}' as value for -E | --env, but environment variable '${flags.env}' is not available globally`
283279
);
284280
}
285281
return process.env[flags.env];

@commitlint/config-angular-type-enum/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ const types = require('@commitlint/config-angular-type-enum');
2828
// Use as rule creating errors for non-allowed types
2929
module.exports = {
3030
rules: {
31-
...types.rules
32-
}
31+
...types.rules,
32+
},
3333
};
3434

3535
// Warn for non-allowed types
3636
module.exports = {
3737
rules: {
38-
'type-enum': [1, 'always', types.values()]
39-
}
38+
'type-enum': [1, 'always', types.values()],
39+
},
4040
};
4141
```

@commitlint/config-angular-type-enum/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ const types = [
88
'refactor',
99
'revert',
1010
'style',
11-
'test'
11+
'test',
1212
];
1313

1414
module.exports.rules = {
15-
'type-enum': [2, 'always', types]
15+
'type-enum': [2, 'always', types],
1616
};
1717

1818
module.exports.value = () => types;

@commitlint/config-angular/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ module.exports = {
99
'subject-case': [
1010
2,
1111
'never',
12-
['sentence-case', 'start-case', 'pascal-case', 'upper-case']
12+
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
1313
],
1414
'subject-empty': [2, 'never'],
1515
'subject-full-stop': [2, 'never', '.'],
1616
'type-case': [2, 'always', 'lower-case'],
1717
'type-empty': [2, 'never'],
18-
'type-enum': typeEnum.rules['type-enum']
19-
}
18+
'type-enum': typeEnum.rules['type-enum'],
19+
},
2020
};

@commitlint/config-conventional/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
'subject-case': [
1111
2,
1212
'never',
13-
['sentence-case', 'start-case', 'pascal-case', 'upper-case']
13+
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
1414
],
1515
'subject-empty': [2, 'never'],
1616
'subject-full-stop': [2, 'never', '.'],
@@ -30,8 +30,8 @@ module.exports = {
3030
'refactor',
3131
'revert',
3232
'style',
33-
'test'
34-
]
35-
]
36-
}
33+
'test',
34+
],
35+
],
36+
},
3737
};

0 commit comments

Comments
 (0)