Skip to content

Commit d2f1535

Browse files
committed
fix: overrides in node_modules seems not working
1 parent caeecde commit d2f1535

File tree

9 files changed

+44
-39
lines changed

9 files changed

+44
-39
lines changed

.babelrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

.eslintrc.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ module.exports = {
77
},
88
},
99
},
10-
extends: [
11-
'plugin:jest/recommended',
12-
'1stg/react',
13-
'plugin:@rxts/mdx/recommended',
14-
],
10+
extends: ['plugin:jest/recommended', '1stg/react'],
1511
rules: {
1612
'@typescript-eslint/no-explicit-any': 0,
1713
'@typescript-eslint/array-type': [
@@ -23,16 +19,20 @@ module.exports = {
2319
},
2420
overrides: [
2521
{
26-
files: ['*.ts', '*.tsx'],
22+
files: ['*.d.ts'],
2723
rules: {
28-
'react/prop-types': 0,
24+
'import/order': 0,
25+
'import/no-unresolved': 0,
2926
},
3027
},
3128
{
32-
files: ['*.d.ts'],
29+
files: ['*.mdx'],
30+
extends: ['plugin:@rxts/mdx/recommended'],
31+
},
32+
{
33+
files: ['*.ts', '*.tsx'],
3334
rules: {
34-
'import/order': 0,
35-
'import/no-unresolved': 0,
35+
'react/prop-types': 0,
3636
},
3737
},
3838
],

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: node_js
22

3-
node_js:
4-
- --lts
5-
- stable
3+
node_js: --lts
64

75
cache: yarn
86

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ npm i @rxts/eslint-plugin-mdx
2525

2626
```json
2727
{
28-
"extends": ["plugin:@rxts/mdx/recommended"]
28+
"overrides": [
29+
{
30+
"files": ["*.mdx"],
31+
"extends": ["plugin:@rxts/mdx/recommended"]
32+
}
33+
]
2934
}
3035
```
3136

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rxts/eslint-plugin-mdx",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "ESLint Parser/Plugin for MDX",
55
"repository": "[email protected]:rx-ts/eslint-plugin-mdx.git",
66
"author": "JounQin <[email protected]>",
@@ -14,7 +14,7 @@
1414
"prepublishOnly": "yarn build",
1515
"build": "tsc -P src",
1616
"test": "jest",
17-
"lint": "eslint . --ext js,ts,mdx"
17+
"lint": "eslint . --ext mdx,ts,tsx"
1818
},
1919
"peerDependencies": {
2020
"eslint": ">=4.7.0"
@@ -34,6 +34,7 @@
3434
"@types/eslint-visitor-keys": "^1.0.0",
3535
"@types/estree": "^0.0.39",
3636
"@types/node": "^12.6.8",
37+
"@types/react": "^16.8.23",
3738
"@types/unist": "^2.0.3",
3839
"commitlint": "^8.1.0",
3940
"eslint": "^6.1.0",

src/index.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ export { parseForESLint } from './parser'
44

55
export const configs = {
66
recommended: {
7-
overrides: [
8-
{
9-
files: '*.mdx',
10-
parser: path.resolve(__dirname, 'parser'),
11-
plugins: ['@rxts/mdx'],
12-
rules: {
13-
'react/react-in-jsx-scope': 0,
14-
},
15-
},
16-
],
7+
parser: path.resolve(__dirname, 'parser'),
8+
plugins: ['@rxts/mdx'],
9+
rules: {
10+
'react/react-in-jsx-scope': 0,
11+
},
1712
},
1813
}

test/test.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import { Test } from './test'
22

33
# Hello
44

5-
<Test prop={1} />
5+
export const Export = () => <Test prop={1} />
File renamed without changes.

yarn.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,19 @@
600600
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
601601
integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==
602602

603+
"@types/prop-types@*":
604+
version "15.7.1"
605+
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6"
606+
integrity sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg==
607+
608+
"@types/react@^16.8.23":
609+
version "16.8.23"
610+
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.23.tgz#ec6be3ceed6353a20948169b6cb4c97b65b97ad2"
611+
integrity sha512-abkEOIeljniUN9qB5onp++g0EY38h7atnDHxwKUFz1r3VH1+yG1OKi2sNPTyObL40goBmfKFpdii2lEzwLX1cA==
612+
dependencies:
613+
"@types/prop-types" "*"
614+
csstype "^2.2.0"
615+
603616
"@types/semver@^6.0.1":
604617
version "6.0.1"
605618
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.0.1.tgz#a984b405c702fa5a7ec6abc56b37f2ba35ef5af6"
@@ -1553,6 +1566,11 @@ cssstyle@^1.0.0:
15531566
dependencies:
15541567
cssom "0.3.x"
15551568

1569+
csstype@^2.2.0:
1570+
version "2.6.6"
1571+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.6.tgz#c34f8226a94bbb10c32cc0d714afdf942291fc41"
1572+
integrity sha512-RpFbQGUE74iyPgvr46U9t1xoQBM8T4BL8SxrN66Le2xYAPSaDJJKeztV3awugusb3g3G9iL8StmkBBXhcbbXhg==
1573+
15561574
currently-unhandled@^0.4.1:
15571575
version "0.4.1"
15581576
resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"

0 commit comments

Comments
 (0)