Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update repo #215

Merged
merged 3 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ module.exports = {
"unicorn/filename-case": "off",
"unicorn/no-array-for-each": "off",
"unicorn/no-array-reduce": "off",
"unicorn/no-empty-file": "off",
"unicorn/no-nested-ternary": "off",
"unicorn/no-null": "off",
"unicorn/no-reduce": "off",
"unicorn/numeric-separators-style": "off",
"unicorn/prefer-flat-map": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-spread": "off",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [15.x]
node-version: [16]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -31,7 +31,7 @@ jobs:

- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci
run: npm ci --no-audit

- name: ESLint
run: npx --no-install eslint .
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [12, 14, 16, 17]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -31,7 +31,7 @@ jobs:

- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci
run: npm ci --no-audit

- name: Jest
run: npx --no-install jest
Expand Down
51 changes: 2 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,6 @@ This lets you use your favorite shareable config without letting its stylistic c

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

---

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Installation](#installation)
- [Excluding deprecated rules](#excluding-deprecated-rules)
- [CLI helper tool](#cli-helper-tool)
- [Legacy](#legacy)
- [Special rules](#special-rules)
- [arrow-body-style and prefer-arrow-callback](#arrow-body-style-and-prefer-arrow-callback)
- [curly](#curly)
- [lines-around-comment](#lines-around-comment)
- [max-len](#max-len)
- [no-confusing-arrow](#no-confusing-arrow)
- [no-mixed-operators](#no-mixed-operators)
- [no-tabs](#no-tabs)
- [no-unexpected-multiline](#no-unexpected-multiline)
- [quotes](#quotes)
- [Enforce backticks](#enforce-backticks)
- [Forbid unnecessary backticks](#forbid-unnecessary-backticks)
- [Example double quote configuration](#example-double-quote-configuration)
- [Example single quote configuration](#example-single-quote-configuration)
- [vue/html-self-closing](#vuehtml-self-closing)
- [Other rules worth mentioning](#other-rules-worth-mentioning)
- [no-sequences](#no-sequences)
- [Contributing](#contributing)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Installation

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

## Contributing

eslint-config-prettier has been tested with:

- ESLint 7.25.0
- 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.
- eslint-config-prettier 6.11.0 and older were tested with ESLint 6.x
- eslint-config-prettier 5.1.0 and older were tested with ESLint 5.x
- eslint-config-prettier 2.10.0 and older were tested with ESLint 4.x
- eslint-config-prettier 2.1.1 and older were tested with ESLint 3.x
- prettier 2.2.1
- @babel/eslint-plugin 7.13.16
- @typescript-eslint/eslint-plugin 4.22.0
- eslint-plugin-babel 5.3.1
- eslint-plugin-flowtype 5.7.2
- eslint-plugin-prettier 3.4.0
- eslint-plugin-react 7.23.2
- eslint-plugin-standard 4.0.2
- eslint-plugin-unicorn 31.0.0
- eslint-plugin-vue 7.9.0
See [package.json] for the exact versions of ESLint, Prettier and ESLint plugins that eslint-config-prettier has been tested with.

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!

Expand Down Expand Up @@ -757,6 +709,7 @@ When you’re done, run `npm test` to verify that you got it all right. It runs
[no-tabs]: https://eslint.org/docs/rules/no-tabs
[no-unexpected-multiline]: https://eslint.org/docs/rules/no-unexpected-multiline
[overrides]: https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns
[package.json]: https://github.com/prettier/eslint-config-prettier/blob/main/package.json
[prefer-arrow-callback]: https://eslint.org/docs/rules/prefer-arrow-callback
[prettier]: https://github.com/prettier/prettier
[quotes]: https://eslint.org/docs/rules/quotes
Expand Down
17 changes: 7 additions & 10 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ if (module === require.main) {

Promise.all(args.map((file) => eslint.calculateConfigForFile(file)))
.then((configs) => {
const rules = [].concat(
...configs.map(({ rules }, index) =>
Object.entries(rules).map((entry) => [...entry, args[index]])
)
const rules = configs.flatMap(({ rules }, index) =>
Object.entries(rules).map((entry) => [...entry, args[index]])
);
const result = processRules(rules);
if (result.stderr) {
Expand Down Expand Up @@ -183,12 +181,11 @@ function processRules(configRules) {
}

function filterRules(rules, fn) {
return Object.entries(rules)
.filter(([ruleName, value]) => fn(ruleName, value))
.reduce((obj, [ruleName]) => {
obj[ruleName] = true;
return obj;
}, Object.create(null));
return Object.fromEntries(
Object.entries(rules)
.filter(([ruleName, value]) => fn(ruleName, value))
.map(([ruleName]) => [ruleName, true])
);
}

function filterRuleNames(rules, fn) {
Expand Down
Loading