Skip to content

Commit 7ee41f1

Browse files
authored
Update repo (#215)
1 parent 23c8169 commit 7ee41f1

File tree

10 files changed

+11491
-6873
lines changed

10 files changed

+11491
-6873
lines changed

.eslintrc.base.js

+2
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ module.exports = {
5656
"unicorn/filename-case": "off",
5757
"unicorn/no-array-for-each": "off",
5858
"unicorn/no-array-reduce": "off",
59+
"unicorn/no-empty-file": "off",
5960
"unicorn/no-nested-ternary": "off",
6061
"unicorn/no-null": "off",
6162
"unicorn/no-reduce": "off",
63+
"unicorn/numeric-separators-style": "off",
6264
"unicorn/prefer-flat-map": "off",
6365
"unicorn/prefer-module": "off",
6466
"unicorn/prefer-spread": "off",

.github/workflows/check.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest]
16-
node-version: [15.x]
16+
node-version: [16]
1717

1818
steps:
1919
- uses: actions/checkout@v2
2020

21-
- uses: actions/setup-node@v1
21+
- uses: actions/setup-node@v2
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424

@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: npm ci
3333
if: steps.cache-node_modules.outputs.cache-hit != 'true'
34-
run: npm ci
34+
run: npm ci --no-audit
3535

3636
- name: ESLint
3737
run: npx --no-install eslint .

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest, windows-latest, macOS-latest]
16-
node-version: [10.x, 12.x, 14.x, 15.x]
16+
node-version: [12, 14, 16, 17]
1717

1818
steps:
1919
- uses: actions/checkout@v2
2020

21-
- uses: actions/setup-node@v1
21+
- uses: actions/setup-node@v2
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424

@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: npm ci
3333
if: steps.cache-node_modules.outputs.cache-hit != 'true'
34-
run: npm ci
34+
run: npm ci --no-audit
3535

3636
- name: Jest
3737
run: npx --no-install jest

README.md

+2-49
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,6 @@ This lets you use your favorite shareable config without letting its stylistic c
66

77
Note that this config _only_ turns rules _off,_ so it only makes sense using it together with some other config.
88

9-
---
10-
11-
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
12-
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
13-
14-
- [Installation](#installation)
15-
- [Excluding deprecated rules](#excluding-deprecated-rules)
16-
- [CLI helper tool](#cli-helper-tool)
17-
- [Legacy](#legacy)
18-
- [Special rules](#special-rules)
19-
- [arrow-body-style and prefer-arrow-callback](#arrow-body-style-and-prefer-arrow-callback)
20-
- [curly](#curly)
21-
- [lines-around-comment](#lines-around-comment)
22-
- [max-len](#max-len)
23-
- [no-confusing-arrow](#no-confusing-arrow)
24-
- [no-mixed-operators](#no-mixed-operators)
25-
- [no-tabs](#no-tabs)
26-
- [no-unexpected-multiline](#no-unexpected-multiline)
27-
- [quotes](#quotes)
28-
- [Enforce backticks](#enforce-backticks)
29-
- [Forbid unnecessary backticks](#forbid-unnecessary-backticks)
30-
- [Example double quote configuration](#example-double-quote-configuration)
31-
- [Example single quote configuration](#example-single-quote-configuration)
32-
- [vue/html-self-closing](#vuehtml-self-closing)
33-
- [Other rules worth mentioning](#other-rules-worth-mentioning)
34-
- [no-sequences](#no-sequences)
35-
- [Contributing](#contributing)
36-
- [License](#license)
37-
38-
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
39-
409
## Installation
4110

4211
Install eslint-config-prettier:
@@ -666,24 +635,7 @@ You can also supply a custom message if you want:
666635

667636
## Contributing
668637

669-
eslint-config-prettier has been tested with:
670-
671-
- ESLint 7.25.0
672-
- eslint-config-prettier 7.0.0 requires ESLint 7.0.0 or newer, while eslint-config-prettier 6.15.0 and older should also work with ESLint versions down to 3.x.
673-
- eslint-config-prettier 6.11.0 and older were tested with ESLint 6.x
674-
- eslint-config-prettier 5.1.0 and older were tested with ESLint 5.x
675-
- eslint-config-prettier 2.10.0 and older were tested with ESLint 4.x
676-
- eslint-config-prettier 2.1.1 and older were tested with ESLint 3.x
677-
- prettier 2.2.1
678-
- @babel/eslint-plugin 7.13.16
679-
- @typescript-eslint/eslint-plugin 4.22.0
680-
- eslint-plugin-babel 5.3.1
681-
- eslint-plugin-flowtype 5.7.2
682-
- eslint-plugin-prettier 3.4.0
683-
- eslint-plugin-react 7.23.2
684-
- eslint-plugin-standard 4.0.2
685-
- eslint-plugin-unicorn 31.0.0
686-
- eslint-plugin-vue 7.9.0
638+
See [package.json] for the exact versions of ESLint, Prettier and ESLint plugins that eslint-config-prettier has been tested with.
687639

688640
Have new rules been added since those versions? Have we missed any rules? Is there a plugin you would like to see exclusions for? Open an issue or a pull request!
689641

@@ -757,6 +709,7 @@ When you’re done, run `npm test` to verify that you got it all right. It runs
757709
[no-tabs]: https://eslint.org/docs/rules/no-tabs
758710
[no-unexpected-multiline]: https://eslint.org/docs/rules/no-unexpected-multiline
759711
[overrides]: https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns
712+
[package.json]: https://github.com/prettier/eslint-config-prettier/blob/main/package.json
760713
[prefer-arrow-callback]: https://eslint.org/docs/rules/prefer-arrow-callback
761714
[prettier]: https://github.com/prettier/prettier
762715
[quotes]: https://eslint.org/docs/rules/quotes

bin/cli.js

+7-10
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ if (module === require.main) {
3030

3131
Promise.all(args.map((file) => eslint.calculateConfigForFile(file)))
3232
.then((configs) => {
33-
const rules = [].concat(
34-
...configs.map(({ rules }, index) =>
35-
Object.entries(rules).map((entry) => [...entry, args[index]])
36-
)
33+
const rules = configs.flatMap(({ rules }, index) =>
34+
Object.entries(rules).map((entry) => [...entry, args[index]])
3735
);
3836
const result = processRules(rules);
3937
if (result.stderr) {
@@ -183,12 +181,11 @@ function processRules(configRules) {
183181
}
184182

185183
function filterRules(rules, fn) {
186-
return Object.entries(rules)
187-
.filter(([ruleName, value]) => fn(ruleName, value))
188-
.reduce((obj, [ruleName]) => {
189-
obj[ruleName] = true;
190-
return obj;
191-
}, Object.create(null));
184+
return Object.fromEntries(
185+
Object.entries(rules)
186+
.filter(([ruleName, value]) => fn(ruleName, value))
187+
.map(([ruleName]) => [ruleName, true])
188+
);
192189
}
193190

194191
function filterRuleNames(rules, fn) {

0 commit comments

Comments
 (0)