Skip to content

Commit

Permalink
fix(core): add missing dependencies although it worked
Browse files Browse the repository at this point in the history
thanks to eslint-plugin-node
  • Loading branch information
JounQin committed Sep 7, 2019
1 parent 9e50e01 commit b742150
Show file tree
Hide file tree
Showing 12 changed files with 384 additions and 278 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ module.exports = {
...overrides,
{
files: '*.ts',
settings: {
node: {
allowModules: ['@babel/types', 'estree', 'unist'],
},
},
rules: {
'@typescript-eslint/unbound-method': 0, // See /~https://github.com/typescript-eslint/typescript-eslint/issues/636
},
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ deploy:
after_script:
- yarn add -D @codechecks/client @codechecks/build-size-watcher @codechecks/type-coverage-watcher codacy-coverage -W
- yarn codechecks
- cat ./coverage/lcov.info | codacy-coverage
- cat ./coverage/lcov.info | yarn codacy-coverage
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Integration with [remark-lint][] plugins, it will read [remark's configuration](

## Prettier Integration

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]_.
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][]_.
```json
{
Expand Down
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,26 @@
"type-coverage": "type-coverage --cache --ignore-catch --detail --ignore-files *.d.ts --strict"
},
"devDependencies": {
"@1stg/babel-preset": "^0.5.0",
"@1stg/eslint-config": "^0.6.0",
"@1stg/babel-preset": "^0.6.0",
"@1stg/browserslist-config": "^0.2.1",
"@1stg/eslint-config": "^0.9.0",
"@1stg/husky-config": "^0.3.0",
"@1stg/lint-staged": "^0.5.0",
"@1stg/lint-staged": "^0.6.0",
"@1stg/prettier-config": "^0.2.0",
"@1stg/tsconfig": "^0.3.0",
"@babel/core": "^7.5.5",
"@1stg/remark-config": "^0.2.0",
"@1stg/tsconfig": "^0.5.0",
"@babel/core": "^7.6.0",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"@types/cosmiconfig": "^5.0.3",
"@types/eslint": "^6.1.1",
"@types/jest": "^24.0.18",
"@types/node": "^12.7.3",
"@types/node": "^12.7.4",
"@types/react": "^16.9.2",
"@types/rebass": "^4.0.0",
"@types/unist": "^2.0.3",
"babel-eslint": "^11.0.0-beta.0",
"browserslist": "^4.7.0",
"eslint": "^6.3.0",
"eslint-formatter-friendly": "^7.0.0",
"eslint-mdx": "link:packages/eslint-mdx/src",
Expand All @@ -54,6 +57,9 @@
"type-coverage": "^2.2.0",
"typescript": "^3.6.2"
},
"browserslist": [
"extends @1stg/browserslist-config/latest"
],
"commitlint": {
"extends": [
"@commitlint/config-conventional"
Expand Down Expand Up @@ -85,10 +91,7 @@
"prettier": "@1stg/prettier-config",
"remarkConfig": {
"plugins": [
"preset-lint-consistent",
"preset-lint-recommended",
"preset-lint-markdown-style-guide",
"preset-prettier"
"@1stg/remark-config"
]
},
"renovate": {
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-mdx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ npm i -D eslint-plugin-mdx

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.

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.
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.

## Rules

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

## Prettier Integration

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]_.
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][]_.
```json
{
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"eslint": ">=5.0.0"
},
"dependencies": {
"espree": "^6.1.1",
"remark-mdx": "^1.4.3",
"remark-parse": "^7.0.1"
"remark-parse": "^7.0.1",
"unified": "^8.3.2"
}
}
2 changes: 1 addition & 1 deletion packages/eslint-plugin-mdx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Integration with [remark-lint][] plugins, it will read [remark's configuration](

## Prettier Integration

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]_.
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][]_.
```json
{
Expand Down
7 changes: 5 additions & 2 deletions packages/eslint-plugin-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"cosmiconfig": "^5.2.1",
"eslint-mdx": "^1.4.2",
"rebass": "^4.0.5",
"remark-lint-file-extension": "^1.0.3",
"remark-stringify": "^7.0.2"
"remark-mdx": "^1.4.4",
"remark-parse": "^7.0.1",
"remark-stringify": "^7.0.2",
"vfile": "^4.0.1",
"unified": "^8.3.2"
}
}
9 changes: 7 additions & 2 deletions packages/eslint-plugin-mdx/src/rules/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ export const getRemarkProcessor = (searchFrom: string) => {
/* istanbul ignore next */
const { plugins = [], settings }: Partial<RemarkConfig> = config || {}

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

return plugins
.reduce(
Expand Down
6 changes: 0 additions & 6 deletions packages/eslint-plugin-mdx/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,3 @@ declare module 'eslint-plugin-react/lib/rules/no-unescaped-entities' {
const reactNoUnescapedEntities: Rule.RuleModule
export = reactNoUnescapedEntities
}

declare module 'vfile-reporter' {
import { VFile } from 'vfile'
const report: (content: Error | VFile) => string
export = report
}
1 change: 1 addition & 0 deletions test/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ParserOptions,
DEFAULT_PARSER_OPTIONS as parserOptions,
} from 'eslint-mdx'
// eslint-disable-next-line node/no-extraneous-import
import { parse } from 'espree'

import { noop } from './helper'
Expand Down
Loading

0 comments on commit b742150

Please sign in to comment.