From 8841cde77c5455d79b57174f06f965ad730f0f81 Mon Sep 17 00:00:00 2001 From: JounQin Date: Fri, 30 Aug 2019 23:59:19 +0800 Subject: [PATCH] feat: support lint markdown files, add standard-react config --- package.json | 2 +- packages/eslint-config/overrides.js | 15 +++++++++++++-- packages/eslint-config/package.json | 5 ++--- yarn.lock | 19 ++++++++++++++++++- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3c067b35..2505b5a6 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@babel/core": "^7.5.5", "@commitlint/config-conventional": "^8.1.0", "@types/jest": "^24.0.18", - "@types/node": "^12.7.2", + "@types/node": "^12.7.3", "@types/react": "^16.9.2", "commitlint": "^8.1.0", "eslint": "^6.2.2", diff --git a/packages/eslint-config/overrides.js b/packages/eslint-config/overrides.js index b09c724d..ec4c8221 100644 --- a/packages/eslint-config/overrides.js +++ b/packages/eslint-config/overrides.js @@ -159,7 +159,12 @@ exports.tslint = { exports.react = { files: '*.{js,jsx,tsx}', - extends: ['plugin:react/recommended', 'prettier/react'], + extends: [ + 'standard-react', + 'plugin:react/recommended', + 'prettier', + 'prettier/react', + ], settings: { react: { version: 'detect', @@ -221,8 +226,13 @@ exports.vue = { plugins: ['vue'], } +exports.md = { + files: '*.md', + extends: ['plugin:mdx/recommended'], +} + exports.mdx = Object.assign({}, exports.react, { - files: ['*.mdx'], + files: '*.mdx', extends: exports.react.extends.concat([ 'plugin:mdx/recommended', 'plugin:mdx/overrides', @@ -249,6 +259,7 @@ exports.overrides = [ exports.reactTs, exports.dTs, exports.vue, + exports.md, exports.mdx, exports.jest, ] diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 6a045d24..83d15761 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@1stg/eslint-config", - "version": "0.3.1", + "version": "0.4.0", "description": "Personal but Shareable ESLint Configuration for all 1stG.me projects.", "repository": "git@github.com:1stG/configs.git", "author": "JounQin ", @@ -9,14 +9,13 @@ "eslint": "^6.2.2" }, "dependencies": { - "@1stg/prettier-config": "^0.1.0", - "@1stg/tsconfig": "^0.1.0", "@typescript-eslint/eslint-plugin": "^2.0.0", "@typescript-eslint/eslint-plugin-tslint": "^2.0.0", "@typescript-eslint/parser": "^2.0.0", "babel-eslint": "^11.0.0-beta.0", "eslint-config-prettier": "^6.1.0", "eslint-config-standard": "^14.1.0", + "eslint-config-standard-react": "^9.1.0", "eslint-import-resolver-typescript": "JounQin/eslint-import-resolver-typescript#feat/resolve_dts", "eslint-plugin-babel": "^5.3.0", "eslint-plugin-import": "^2.18.2", diff --git a/yarn.lock b/yarn.lock index 6fe85ca9..1dadc971 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2346,11 +2346,16 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*", "@types/node@^12.0.2", "@types/node@^12.7.2": +"@types/node@*", "@types/node@^12.0.2": version "12.7.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.2.tgz#c4e63af5e8823ce9cc3f0b34f7b998c2171f0c44" integrity sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg== +"@types/node@^12.7.3": + version "12.7.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.3.tgz#27b3f40addaf2f580459fdb405222685542f907a" + integrity sha512-3SiLAIBkDWDg6vFo0+5YJyHPWU9uwu40Qe+v+0MH8wRKYBimHvvAOyk3EzMrD/TrIlLYfXrqDqrg913PynrMJQ== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -4236,6 +4241,18 @@ eslint-config-prettier@^6.1.0: dependencies: get-stdin "^6.0.0" +eslint-config-standard-jsx@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-8.1.0.tgz#314c62a0e6f51f75547f89aade059bec140edfc7" + integrity sha512-ULVC8qH8qCqbU792ZOO6DaiaZyHNS/5CZt3hKqHkEhVlhPEPN3nfBqqxJCyp59XrjIBZPu1chMYe9T2DXZ7TMw== + +eslint-config-standard-react@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard-react/-/eslint-config-standard-react-9.1.0.tgz#6f08368db869064548846a851c3d6d72391268f9" + integrity sha512-CCJcGPtpGv29+ntl8OMc3I77Z36xZLIFopXR18i8omAVZko5MSruEXreGzGlnzbvPI5dCMCwt5xGN5djUqoGWw== + dependencies: + eslint-config-standard-jsx "^8.0.0" + eslint-config-standard@^14.1.0: version "14.1.0" resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.1.0.tgz#b23da2b76fe5a2eba668374f246454e7058f15d4"