Skip to content

Commit 14f7711

Browse files
committed
docs: improve eslint@5 usage documentation
1 parent beadaf1 commit 14f7711

File tree

3 files changed

+21
-66
lines changed

3 files changed

+21
-66
lines changed

README.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
[![Travis](https://img.shields.io/travis/com/rx-ts/eslint-mdx.svg)](https://travis-ci.com/rx-ts/eslint-mdx)
1414
[![Codecov](https://img.shields.io/codecov/c/gh/rx-ts/eslint-mdx)](https://codecov.io/gh/rx-ts/eslint-mdx)
15-
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-mdx%2Fmaster%2Fpackage.json)](https://github.com/rx-ts/eslint-mdx)
15+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-mdx%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
1616
[![GitHub release](https://img.shields.io/github/release/rx-ts/eslint-mdx)](https://github.com/rx-ts/eslint-mdx/releases)
1717
[![David Dev](https://img.shields.io/david/dev/rx-ts/eslint-mdx.svg)](https://david-dm.org/rx-ts/eslint-mdx?type=dev)
1818
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
@@ -67,33 +67,18 @@ npm i -D @rxts/eslint-plugin-mdx
6767
2. If you're using `eslint@^5.0.0`, you need to enable this parser/plugin manually, because `eslint@5` does not support `extends` for `overrides` property in its configuration:
6868

6969
```js
70+
const { configs } = require('@rxts/eslint-plugin-mdx')
7071
const rebass = require('rebass')
7172

7273
module.exports = {
7374
extends: ['plugin:@rxts/mdx/recommended'],
7475
overrides: [
75-
{
76-
files: ['*.mdx'],
77-
globals: Object.keys(rebass).reduce(
78-
(globals, Component) =>
79-
Object.assign(globals, {
80-
[Component]: false,
81-
}),
82-
{
83-
React: false,
84-
},
85-
),
86-
rules: {
87-
'lines-between-class-members': 0,
88-
'react/jsx-no-undef': [
89-
2,
90-
{
91-
allowGlobals: true,
92-
},
93-
],
94-
'react/react-in-jsx-scope': 0,
76+
Object.assign(
77+
{
78+
files: ['*.mdx'],
9579
},
96-
},
80+
configs.overrides,
81+
),
9782
],
9883
}
9984
```

packages/eslint-mdx/README.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
[![Travis](https://img.shields.io/travis/com/rx-ts/eslint-mdx.svg)](https://travis-ci.com/rx-ts/eslint-mdx)
1414
[![Codecov](https://img.shields.io/codecov/c/gh/rx-ts/eslint-mdx)](https://codecov.io/gh/rx-ts/eslint-mdx)
15-
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-mdx%2Fmaster%2Fpackage.json)](https://github.com/rx-ts/eslint-mdx)
15+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-mdx%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
1616
[![GitHub release](https://img.shields.io/github/release/rx-ts/eslint-mdx)](https://github.com/rx-ts/eslint-mdx/releases)
1717
[![David Dev](https://img.shields.io/david/dev/rx-ts/eslint-mdx.svg)](https://david-dm.org/rx-ts/eslint-mdx?type=dev)
1818
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
@@ -67,33 +67,18 @@ npm i -D @rxts/eslint-plugin-mdx
6767
2. If you're using `eslint@^5.0.0`, you need to enable this parser/plugin manually, because `eslint@5` does not support `extends` for `overrides` property in its configuration:
6868

6969
```js
70+
const { configs } = require('@rxts/eslint-plugin-mdx')
7071
const rebass = require('rebass')
7172

7273
module.exports = {
7374
extends: ['plugin:@rxts/mdx/recommended'],
7475
overrides: [
75-
{
76-
files: ['*.mdx'],
77-
globals: Object.keys(rebass).reduce(
78-
(globals, Component) =>
79-
Object.assign(globals, {
80-
[Component]: false,
81-
}),
82-
{
83-
React: false,
84-
},
85-
),
86-
rules: {
87-
'lines-between-class-members': 0,
88-
'react/jsx-no-undef': [
89-
2,
90-
{
91-
allowGlobals: true,
92-
},
93-
],
94-
'react/react-in-jsx-scope': 0,
76+
Object.assign(
77+
{
78+
files: ['*.mdx'],
9579
},
96-
},
80+
configs.overrides,
81+
),
9782
],
9883
}
9984
```

packages/eslint-plugin-mdx/README.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
[![Travis](https://img.shields.io/travis/com/rx-ts/eslint-mdx.svg)](https://travis-ci.com/rx-ts/eslint-mdx)
1414
[![Codecov](https://img.shields.io/codecov/c/gh/rx-ts/eslint-mdx)](https://codecov.io/gh/rx-ts/eslint-mdx)
15-
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-mdx%2Fmaster%2Fpackage.json)](https://github.com/rx-ts/eslint-mdx)
15+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-mdx%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
1616
[![GitHub release](https://img.shields.io/github/release/rx-ts/eslint-mdx)](https://github.com/rx-ts/eslint-mdx/releases)
1717
[![David Dev](https://img.shields.io/david/dev/rx-ts/eslint-mdx.svg)](https://david-dm.org/rx-ts/eslint-mdx?type=dev)
1818
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
@@ -67,33 +67,18 @@ npm i -D @rxts/eslint-plugin-mdx
6767
2. If you're using `eslint@^5.0.0`, you need to enable this parser/plugin manually, because `eslint@5` does not support `extends` for `overrides` property in its configuration:
6868

6969
```js
70+
const { configs } = require('@rxts/eslint-plugin-mdx')
7071
const rebass = require('rebass')
7172

7273
module.exports = {
7374
extends: ['plugin:@rxts/mdx/recommended'],
7475
overrides: [
75-
{
76-
files: ['*.mdx'],
77-
globals: Object.keys(rebass).reduce(
78-
(globals, Component) =>
79-
Object.assign(globals, {
80-
[Component]: false,
81-
}),
82-
{
83-
React: false,
84-
},
85-
),
86-
rules: {
87-
'lines-between-class-members': 0,
88-
'react/jsx-no-undef': [
89-
2,
90-
{
91-
allowGlobals: true,
92-
},
93-
],
94-
'react/react-in-jsx-scope': 0,
76+
Object.assign(
77+
{
78+
files: ['*.mdx'],
9579
},
96-
},
80+
configs.overrides,
81+
),
9782
],
9883
}
9984
```

0 commit comments

Comments
 (0)