diff --git a/.circleci/config.yml b/.circleci/config.yml index 75833b053..f1ad60e66 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,10 +2,28 @@ workflows: version: 2 node-multi-build: jobs: - - node-v6 - - node-v8 - - node-v10 - - node-v10-minimal + - node-v6: + filters: + branches: + ignore: gh-pages + - node-v8: + filters: + branches: + ignore: gh-pages + - node-v10: + filters: + branches: + ignore: gh-pages + - node-v10-minimal: + filters: + branches: + ignore: gh-pages + - deploy_docs: + requires: + - node-v10 + filters: + branches: + only: master version: 2 jobs: @@ -20,19 +38,16 @@ jobs: - restore_cache: keys: - v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} - - v2-npm-lock-master-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} - - v2-npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }} - - v2-npm-cache-master-{{ .Environment.CIRCLE_JOB }} - run: name: Install dependencies command: npm install - - run: - name: Test - command: npm test - save_cache: key: v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} paths: - node_modules + - run: + name: Test + command: npm test node-v6: <<: *node-base @@ -46,6 +61,7 @@ jobs: <<: *node-base docker: - image: node:10 + working_directory: ~/node_10 node-v10-minimal: steps: - run: @@ -73,4 +89,13 @@ jobs: - node_modules docker: - image: node:10 - + + deploy_docs: + docker: + - image: node:10 + steps: + - attach_workspace: + at: ~/node_10 + - run: + name: Deploy to Github Pages + command: npm run docs:deploy diff --git a/.eslintignore b/.eslintignore index 9efb24842..20f3203c8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,3 +3,6 @@ /node_modules /tests/fixtures /tests/integrations/*/node_modules + +!.vuepress +/docs/.vuepress/dist diff --git a/.gitignore b/.gitignore index c07de3ba2..688618a31 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /test.* yarn.lock yarn-error.log +docs/.vuepress/dist diff --git a/.vscode/settings.json b/.vscode/settings.json index 6287f25a9..7bd96f8d9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,10 @@ "editor.tabSize": 2, "eslint.options": { "rulePaths": ["eslint-internal-rules"] - } + }, + "eslint.validate": [ + "javascript", + "javascriptreact", + { "language": "vue", "autoFix": true } + ] } diff --git a/README.md b/README.md index 04a8425e6..ee9d149a4 100644 --- a/README.md +++ b/README.md @@ -7,303 +7,21 @@ > Official ESLint plugin for Vue.js -## :exclamation: Attention - this is documentation for version `5.x` :exclamation: +## :book: Documentation -This branch contains `eslint-plugin-vue@next` which is a pre-released `5.0`, but it's not the default version that you get with `npm install eslint-plugin-vue`. In order to install this you need to specify either `"eslint-plugin-vue": "next"` in `package.json` or do `npm install eslint-plugin-vue@next`. +See https://vuejs.github.io/eslint-plugin-vue/ -Please try it and report any issues that you might have encountered. +> :exclamation: Attention - this is documentation for version `5.x` :exclamation: +> +> This branch contains `eslint-plugin-vue@next` which is a pre-released `5.0`, but it's not the default version that you get with `npm install eslint-plugin-vue`. In order to install this you need to specify either `"eslint-plugin-vue": "next"` in `package.json` or do `npm install eslint-plugin-vue@next`. +> +> Please try it and report any issues that you might have encountered. +> +> If you want to check previous releases [go here](https://github.com/vuejs/eslint-plugin-vue/releases). -If you want to check previous releases [go here](https://github.com/vuejs/eslint-plugin-vue/releases). +## :anchor: Versioning Policy -## :art: Playground on the Web - -You can try this plugin on the Web. - -- https://mysticatea.github.io/vue-eslint-demo/ - -## :grey_exclamation: Requirements - -- [ESLint](http://eslint.org/) `^5.0.0`. -- Node.js `>=6.5.0` - -## :cd: Installation - -```bash -npm install --save-dev eslint eslint-plugin-vue@next -``` - -## :rocket: Usage - -Create `.eslintrc.*` file to configure rules. See also: [http://eslint.org/docs/user-guide/configuring](http://eslint.org/docs/user-guide/configuring). - -Example **.eslintrc.js**: - -```js -module.exports = { - extends: [ - // add more generic rulesets here, such as: - // 'eslint:recommended', - 'plugin:vue/essential' - ], - rules: { - // override/add rules settings here, such as: - // 'vue/no-unused-vars': 'error' - } -} -``` - -### Single File Components - -ESLint only targets `.js` files by default. You must include the `.vue` extension using [the `--ext` option](https://eslint.org/docs/user-guide/configuring#specifying-file-extensions-to-lint) or a glob pattern. - -Examples: - -```bash -eslint --ext .js,.vue src -eslint src/**/*.{js,vue} -``` - -### Attention - -All component-related rules are being applied to code that passes any of the following checks: - -* `Vue.component()` expression -* `Vue.extend()` expression -* `Vue.mixin()` expression -* `export default {}` in `.vue` or `.jsx` file - -If you however want to take advantage of our rules in any of your custom objects that are Vue components, you might need to use special comment `// @vue/component` that marks object in the next line as a Vue component in any file, e.g.: - -```js -// @vue/component -const CustomComponent = { - name: 'custom-component', - template: '
' -} -``` -```js -Vue.component('AsyncComponent', (resolve, reject) => { - setTimeout(() => { - // @vue/component - resolve({ - name: 'async-component', - template: '
' - }) - }, 500) -}) -``` - -### `eslint-disable` functionality in `