From fb94d7b20b6eded652b911cd82626c798192ea9e Mon Sep 17 00:00:00 2001 From: Clark Du Date: Wed, 5 Dec 2018 15:16:52 +0000 Subject: [PATCH] feat: add base config --- lib/configs/base.js | 17 +++++++++++++++++ lib/index.js | 11 +++++++++++ lib/processors/index.js | 1 + package.json | 3 ++- 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 lib/configs/base.js create mode 100644 lib/processors/index.js diff --git a/lib/configs/base.js b/lib/configs/base.js new file mode 100644 index 0000000..bb0b4cf --- /dev/null +++ b/lib/configs/base.js @@ -0,0 +1,17 @@ +module.exports = { + parser: require.resolve('vue-eslint-parser'), + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + ecmaFeatures: { + jsx: true + } + }, + env: { + browser: true, + es6: true + }, + rules: { + 'nuxt/no-this-in-async-data': 'error' + } +} diff --git a/lib/index.js b/lib/index.js index e69de29..2c9886c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -0,0 +1,11 @@ +module.exports = { + rules: { + 'no-this-in-async-data': require('./lib/rules/no-this-in-async-data') + }, + configs: { + 'base': require('./configs/base') + }, + processors: { + '.vue': require('./processors') + } +} diff --git a/lib/processors/index.js b/lib/processors/index.js new file mode 100644 index 0000000..607d74b --- /dev/null +++ b/lib/processors/index.js @@ -0,0 +1 @@ +module.exports = require('eslint-plugin-vue/lib/processor') diff --git a/package.json b/package.json index f171691..7af454b 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "lint-staged": "^8.1.0" }, "dependencies": { - "eslint-plugin-vue": "^5.0.0" + "eslint-plugin-vue": "^5.0.0", + "vue-eslint-parser": "^4.0.2" } }