Skip to content

Commit fd3e746

Browse files
committed
first blood, no support for parser, yet
1 parent a2a27b2 commit fd3e746

File tree

14 files changed

+5934
-2
lines changed

14 files changed

+5934
-2
lines changed

.babelrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"node": true
8+
}
9+
}
10+
]
11+
]
12+
}

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
tab_width = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
*.log

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'plugin:jest/recommended',
5+
'1stg/react',
6+
'plugin:@rxts/mdx/recommended',
7+
],
8+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
*.log

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"prettier-config-1stg"

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: node_js
2+
3+
cache: yarn
4+
5+
node_js:
6+
- '9'
7+
- '8'
8+
9+
script:
10+
- yarn lint
11+
- yarn build

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
# eslint-plugin-mdx
2-
ESLint Parser/Plugin for MDX
1+
# `eslint-parser-mdx`
2+
3+
[![Travis](https://img.shields.io/travis/com/rx-ts/eslint-plugin-mdx.svg?style=flat-square)](https://travis-ci.com/rx-ts/eslint-plugin-mdx)
4+
[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
5+
[![npm](https://img.shields.io/npm/v/@rxts/eslint-plugin-mdx.svg?style=flat-square)](https://npmjs.org/@rxts/eslint-plugin-mdx)
6+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
7+
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)
8+
9+
> [ESLint](https://eslint.org/) Parser/Plugin for [MDX](https://github.com/mdx-js/mdx)
10+
11+
## Install
12+
13+
```sh
14+
# yarn
15+
yarn add @rxts/eslint-plugin-mdx
16+
17+
# npm
18+
npm i @rxts/eslint-plugin-mdx
19+
```
20+
21+
## Usage
22+
23+
1. In your ESLint config file, add:
24+
25+
```json
26+
{
27+
"extends": ["plugin:@rxts/mdx/recommended"]
28+
}
29+
```
30+
31+
2. Make sure ESLint knows to run on `.mdx` files:
32+
33+
```sh
34+
eslint . --ext js,mdx
35+
```

config/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const path = require('path')
2+
3+
require('@babel/register')
4+
5+
module.exports = require(path.resolve('src'))

package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "@rxts/eslint-plugin-mdx",
3+
"version": "0.1.0",
4+
"description": "ESLint Parser/Plugin for MDX",
5+
"repository": "[email protected]:rx-ts/eslint-plugin-mdx.git",
6+
"author": "JounQin <[email protected]>",
7+
"main": "./dist",
8+
"license": "MIT",
9+
"files": [
10+
"dist"
11+
],
12+
"scripts": {
13+
"prepublishOnly": "yarn build",
14+
"build": "babel src -d dist --copy-files",
15+
"test": "jest",
16+
"lint": "eslint . --ext js,mdx"
17+
},
18+
"peerDependencies": {
19+
"eslint": ">=4.7.0"
20+
},
21+
"dependencies": {
22+
"@mdx-js/mdx": "^1.1.0"
23+
},
24+
"devDependencies": {
25+
"@babel/cli": "^7.5.5",
26+
"@babel/core": "^7.5.5",
27+
"@babel/preset-env": "^7.5.5",
28+
"@babel/register": "^7.5.5",
29+
"@rxts/eslint-plugin-mdx": "file:config",
30+
"eslint": "^6.1.0",
31+
"eslint-config-1stg": "^4.2.3",
32+
"eslint-plugin-jest": "^22.14.0",
33+
"husky": "^3.0.1",
34+
"jest": "^24.8.0",
35+
"prettier": "1.18.2",
36+
"prettier-config-1stg": "^0.1.0",
37+
"react": "^16.8.6"
38+
}
39+
}

0 commit comments

Comments
 (0)