Skip to content

Commit

Permalink
fix: overrides in node_modules seems not working
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jul 29, 2019
1 parent caeecde commit d2f1535
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 39 deletions.
12 changes: 0 additions & 12 deletions .babelrc

This file was deleted.

20 changes: 10 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ module.exports = {
},
},
},
extends: [
'plugin:jest/recommended',
'1stg/react',
'plugin:@rxts/mdx/recommended',
],
extends: ['plugin:jest/recommended', '1stg/react'],
rules: {
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/array-type': [
Expand All @@ -23,16 +19,20 @@ module.exports = {
},
overrides: [
{
files: ['*.ts', '*.tsx'],
files: ['*.d.ts'],
rules: {
'react/prop-types': 0,
'import/order': 0,
'import/no-unresolved': 0,
},
},
{
files: ['*.d.ts'],
files: ['*.mdx'],
extends: ['plugin:@rxts/mdx/recommended'],
},
{
files: ['*.ts', '*.tsx'],
rules: {
'import/order': 0,
'import/no-unresolved': 0,
'react/prop-types': 0,
},
},
],
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: node_js

node_js:
- --lts
- stable
node_js: --lts

cache: yarn

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ npm i @rxts/eslint-plugin-mdx

```json
{
"extends": ["plugin:@rxts/mdx/recommended"]
"overrides": [
{
"files": ["*.mdx"],
"extends": ["plugin:@rxts/mdx/recommended"]
}
]
}
```

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rxts/eslint-plugin-mdx",
"version": "0.1.0",
"version": "0.1.1",
"description": "ESLint Parser/Plugin for MDX",
"repository": "git@github.com:rx-ts/eslint-plugin-mdx.git",
"author": "JounQin <admin@1stg.me>",
Expand All @@ -14,7 +14,7 @@
"prepublishOnly": "yarn build",
"build": "tsc -P src",
"test": "jest",
"lint": "eslint . --ext js,ts,mdx"
"lint": "eslint . --ext mdx,ts,tsx"
},
"peerDependencies": {
"eslint": ">=4.7.0"
Expand All @@ -34,6 +34,7 @@
"@types/eslint-visitor-keys": "^1.0.0",
"@types/estree": "^0.0.39",
"@types/node": "^12.6.8",
"@types/react": "^16.8.23",
"@types/unist": "^2.0.3",
"commitlint": "^8.1.0",
"eslint": "^6.1.0",
Expand Down
15 changes: 5 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@ export { parseForESLint } from './parser'

export const configs = {
recommended: {
overrides: [
{
files: '*.mdx',
parser: path.resolve(__dirname, 'parser'),
plugins: ['@rxts/mdx'],
rules: {
'react/react-in-jsx-scope': 0,
},
},
],
parser: path.resolve(__dirname, 'parser'),
plugins: ['@rxts/mdx'],
rules: {
'react/react-in-jsx-scope': 0,
},
},
}
2 changes: 1 addition & 1 deletion test/test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { Test } from './test'

# Hello

<Test prop={1} />
export const Export = () => <Test prop={1} />
File renamed without changes.
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,19 @@
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==

"@types/prop-types@*":
version "15.7.1"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6"
integrity sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg==

"@types/react@^16.8.23":
version "16.8.23"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.23.tgz#ec6be3ceed6353a20948169b6cb4c97b65b97ad2"
integrity sha512-abkEOIeljniUN9qB5onp++g0EY38h7atnDHxwKUFz1r3VH1+yG1OKi2sNPTyObL40goBmfKFpdii2lEzwLX1cA==
dependencies:
"@types/prop-types" "*"
csstype "^2.2.0"

"@types/semver@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.0.1.tgz#a984b405c702fa5a7ec6abc56b37f2ba35ef5af6"
Expand Down Expand Up @@ -1553,6 +1566,11 @@ cssstyle@^1.0.0:
dependencies:
cssom "0.3.x"

csstype@^2.2.0:
version "2.6.6"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.6.tgz#c34f8226a94bbb10c32cc0d714afdf942291fc41"
integrity sha512-RpFbQGUE74iyPgvr46U9t1xoQBM8T4BL8SxrN66Le2xYAPSaDJJKeztV3awugusb3g3G9iL8StmkBBXhcbbXhg==

currently-unhandled@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"
Expand Down

0 comments on commit d2f1535

Please sign in to comment.