Skip to content

Commit b742150

Browse files
committed
fix(core): add missing dependencies although it worked
thanks to eslint-plugin-node
1 parent 9e50e01 commit b742150

File tree

12 files changed

+384
-278
lines changed

12 files changed

+384
-278
lines changed

.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ module.exports = {
1111
...overrides,
1212
{
1313
files: '*.ts',
14+
settings: {
15+
node: {
16+
allowModules: ['@babel/types', 'estree', 'unist'],
17+
},
18+
},
1419
rules: {
1520
'@typescript-eslint/unbound-method': 0, // See https://github.com/typescript-eslint/typescript-eslint/issues/636
1621
},

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ deploy:
4949
after_script:
5050
- yarn add -D @codechecks/client @codechecks/build-size-watcher @codechecks/type-coverage-watcher codacy-coverage -W
5151
- yarn codechecks
52-
- cat ./coverage/lcov.info | codacy-coverage
52+
- cat ./coverage/lcov.info | yarn codacy-coverage

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Integration with [remark-lint][] plugins, it will read [remark's configuration](
172172

173173
## Prettier Integration
174174

175-
If you're using [remark-lint][] feature with [Prettier][] both together, you can try [remark-preset-prettier][] which helps you to _turn off all rules that are unnecessary or might conflict with [Prettier]_.
175+
If you're using [remark-lint][] feature with [Prettier][] both together, you can try [remark-preset-prettier][] which helps you to _turn off all rules that are unnecessary or might conflict with [Prettier][]_.
176176
177177
```json
178178
{

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,26 @@
1616
"type-coverage": "type-coverage --cache --ignore-catch --detail --ignore-files *.d.ts --strict"
1717
},
1818
"devDependencies": {
19-
"@1stg/babel-preset": "^0.5.0",
20-
"@1stg/eslint-config": "^0.6.0",
19+
"@1stg/babel-preset": "^0.6.0",
20+
"@1stg/browserslist-config": "^0.2.1",
21+
"@1stg/eslint-config": "^0.9.0",
2122
"@1stg/husky-config": "^0.3.0",
22-
"@1stg/lint-staged": "^0.5.0",
23+
"@1stg/lint-staged": "^0.6.0",
2324
"@1stg/prettier-config": "^0.2.0",
24-
"@1stg/tsconfig": "^0.3.0",
25-
"@babel/core": "^7.5.5",
25+
"@1stg/remark-config": "^0.2.0",
26+
"@1stg/tsconfig": "^0.5.0",
27+
"@babel/core": "^7.6.0",
2628
"@commitlint/cli": "^8.1.0",
2729
"@commitlint/config-conventional": "^8.1.0",
2830
"@types/cosmiconfig": "^5.0.3",
2931
"@types/eslint": "^6.1.1",
3032
"@types/jest": "^24.0.18",
31-
"@types/node": "^12.7.3",
33+
"@types/node": "^12.7.4",
3234
"@types/react": "^16.9.2",
3335
"@types/rebass": "^4.0.0",
3436
"@types/unist": "^2.0.3",
3537
"babel-eslint": "^11.0.0-beta.0",
38+
"browserslist": "^4.7.0",
3639
"eslint": "^6.3.0",
3740
"eslint-formatter-friendly": "^7.0.0",
3841
"eslint-mdx": "link:packages/eslint-mdx/src",
@@ -54,6 +57,9 @@
5457
"type-coverage": "^2.2.0",
5558
"typescript": "^3.6.2"
5659
},
60+
"browserslist": [
61+
"extends @1stg/browserslist-config/latest"
62+
],
5763
"commitlint": {
5864
"extends": [
5965
"@commitlint/config-conventional"
@@ -85,10 +91,7 @@
8591
"prettier": "@1stg/prettier-config",
8692
"remarkConfig": {
8793
"plugins": [
88-
"preset-lint-consistent",
89-
"preset-lint-recommended",
90-
"preset-lint-markdown-style-guide",
91-
"preset-prettier"
94+
"@1stg/remark-config"
9295
]
9396
},
9497
"renovate": {

packages/eslint-mdx/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ npm i -D eslint-plugin-mdx
148148

149149
2. `extensions` (`string | string[]`): `eslint-mdx` will only resolve `.mdx` files by default, files with other extensions will be resolved by the `parser` option. If you want to resolve other extensions as like `.mdx`, you can use this option.
150150

151-
3. `markdownExtensions` (`string | string[]`): `eslint-mdx` will only treat `.md` files as plain markdown by default, and will lint them via remark plugins. If you want to resolve other extensions as like `.md`, you can use this option.
151+
3. `markdownExtensions` (`string | string[]`): `eslint-mdx` will only treat `.md` files as plain markdown by default, and will lint them via [remark-lint][] plugins. If you want to resolve other extensions as like `.md`, you can use this option.
152152

153153
## Rules
154154

@@ -172,7 +172,7 @@ Integration with [remark-lint][] plugins, it will read [remark's configuration](
172172

173173
## Prettier Integration
174174

175-
If you're using [remark-lint][] feature with [Prettier][] both together, you can try [remark-preset-prettier][] which helps you to _turn off all rules that are unnecessary or might conflict with [Prettier]_.
175+
If you're using [remark-lint][] feature with [Prettier][] both together, you can try [remark-preset-prettier][] which helps you to _turn off all rules that are unnecessary or might conflict with [Prettier][]_.
176176
177177
```json
178178
{

packages/eslint-mdx/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
"eslint": ">=5.0.0"
2222
},
2323
"dependencies": {
24+
"espree": "^6.1.1",
2425
"remark-mdx": "^1.4.3",
25-
"remark-parse": "^7.0.1"
26+
"remark-parse": "^7.0.1",
27+
"unified": "^8.3.2"
2628
}
2729
}

packages/eslint-plugin-mdx/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Integration with [remark-lint][] plugins, it will read [remark's configuration](
172172

173173
## Prettier Integration
174174

175-
If you're using [remark-lint][] feature with [Prettier][] both together, you can try [remark-preset-prettier][] which helps you to _turn off all rules that are unnecessary or might conflict with [Prettier]_.
175+
If you're using [remark-lint][] feature with [Prettier][] both together, you can try [remark-preset-prettier][] which helps you to _turn off all rules that are unnecessary or might conflict with [Prettier][]_.
176176
177177
```json
178178
{

packages/eslint-plugin-mdx/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
"cosmiconfig": "^5.2.1",
2626
"eslint-mdx": "^1.4.2",
2727
"rebass": "^4.0.5",
28-
"remark-lint-file-extension": "^1.0.3",
29-
"remark-stringify": "^7.0.2"
28+
"remark-mdx": "^1.4.4",
29+
"remark-parse": "^7.0.1",
30+
"remark-stringify": "^7.0.2",
31+
"vfile": "^4.0.1",
32+
"unified": "^8.3.2"
3033
}
3134
}

packages/eslint-plugin-mdx/src/rules/helper.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ export const getRemarkProcessor = (searchFrom: string) => {
6060
/* istanbul ignore next */
6161
const { plugins = [], settings }: Partial<RemarkConfig> = config || {}
6262

63-
// disable this rule automatically since we already have a parser option `extensions`
64-
plugins.push(['lint-file-extension', false])
63+
try {
64+
// disable this rule automatically since we already have a parser option `extensions`
65+
// eslint-disable-next-line node/no-extraneous-require
66+
plugins.push([require.resolve('remark-lint-file-extension'), false])
67+
} catch (e) {
68+
// just ignore if the package does not
69+
}
6570

6671
return plugins
6772
.reduce(

packages/eslint-plugin-mdx/typings.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,3 @@ declare module 'eslint-plugin-react/lib/rules/no-unescaped-entities' {
99
const reactNoUnescapedEntities: Rule.RuleModule
1010
export = reactNoUnescapedEntities
1111
}
12-
13-
declare module 'vfile-reporter' {
14-
import { VFile } from 'vfile'
15-
const report: (content: Error | VFile) => string
16-
export = report
17-
}

0 commit comments

Comments
 (0)