diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..db247200 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1 @@ +comment: off diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 3e9654a6..00000000 --- a/.eslintignore +++ /dev/null @@ -1,9 +0,0 @@ -/.nyc_output -/.temp -/coverage -/node_modules -/src/html/util -/test/fixtures -/test/temp -/index.d.ts -/index.js diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 9d1e855f..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "extends": [ - "mysticatea", - "mysticatea/node", - "mysticatea/modules" - ], - "parser": "typescript-eslint-parser", - "rules": { - "indent": "off", - "indent-legacy": ["error", 4, {"SwitchCase": 1}], - "init-declarations": "off", - "no-constant-condition": "off", - "no-param-reassign": "off", - "no-restricted-globals": ["error", "require"], - "no-undef": "off", - "no-unused-vars": "off", - "no-use-before-define": "off", - "valid-jsdoc": "off", - "node/no-unsupported-features": ["error", {"ignores": ["modules"]}] - }, - "settings": { - "node": { - "tryExtensions": [".ts", ".d.ts", ".js", ".json"] - } - }, - "overrides": [ - { - "files": "typings/**", - "rules": { - "node/no-missing-import": ["error", {"allowModules": ["estree"]}] - } - } - ] -} diff --git a/.gitattributes b/.gitattributes index ba071a99..fa8984c7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ +* text=auto eol=lf /test/fixtures/crlf.vue eol=crlf diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..71f6fe76 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +github: +- ota-meshi +- mysticatea diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..2c55f6c5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,84 @@ +name: Bug report +description: Create a report to help us improve. + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: checkboxes + id: sanity-checks + attributes: + label: Before You File a Bug Report Please Confirm You Have Done The Following... + description: If any of these required steps are not taken, we may not be able to review your issue. Help us to help you! + options: + - label: I'm using [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue). + - label: I'm sure the problem is a parser problem. (If you are not sure, search for the issue in [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) repo and open the issue in [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) repo if there is no solution. + required: true + - label: I have tried restarting my IDE and the issue persists. + required: true + - label: I have updated to the latest version of the packages. + required: true + - type: input + id: eslint-version + attributes: + label: What version of ESLint are you using? + placeholder: 0.0.0 + validations: + required: true + - type: textarea + id: eslint-plugin-vue-version + attributes: + label: What version of `eslint-plugin-vue` and `vue-eslint-parser` are you using? + value: | + - vue-eslint-parser@0.0.0 + - eslint-plugin-vue@0.0.0 + validations: + required: true + - type: textarea + attributes: + label: What did you do? + description: | + Please include a *minimal* reproduction case. + value: | +
+ Configuration + + ``` + + ``` +
+ + ```vue + + ``` + validations: + required: true + - type: textarea + attributes: + label: What did you expect to happen? + description: | + You can use Markdown in this field. + validations: + required: true + - type: textarea + attributes: + label: What actually happened? + description: | + Please copy-paste the actual ESLint output. You can use Markdown in this field. + validations: + required: true + - type: textarea + id: bug-reproduction + attributes: + label: Link to Minimal Reproducible Example + description: | + Create a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. **If a report has no reproduction, it will be closed.** + [Why Reproductions are Required](https://antfu.me/posts/why-reproductions-are-required) + placeholder: | + https://github.com/[your]/[repo] + validations: + required: true + - type: textarea + attributes: + label: Additional comments diff --git a/.github/ISSUE_TEMPLATE/other.md b/.github/ISSUE_TEMPLATE/other.md new file mode 100644 index 00000000..565795b2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other.md @@ -0,0 +1,7 @@ +--- +name: Other +about: An issue that doesn't fit into the other categories. +title: "" +labels: "" +assignees: "" +--- diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..e1d1e9de --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,85 @@ +name: CI +on: + push: + branches: [master, try] + pull_request: + branches: [master] + schedule: + - cron: 0 0 * * 0 + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules + run: git submodule update --init + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + - name: Install Packages + run: npm install + - name: Lint + run: npm run -s lint + + test: + name: Test + strategy: + matrix: + eslint: [9] + node: [18, 20, 21, 'lts/*'] + os: [ubuntu-latest] + include: + # On other platforms + - eslint: 9 + node: 'lts/*' + os: windows-latest + - eslint: 9 + node: 'lts/*' + os: macos-latest + + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules + run: git submodule update --init + - name: Install Node.js v${{ matrix.node }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Install Packages + run: npm install -f + - name: Install ESLint v${{ matrix.eslint }} + run: node scripts/ci-install-eslint ${{ matrix.eslint }} + - name: Build + run: npm run -s build + - name: Test + run: npm run -s test:mocha + test-for-old-eslint: + name: Test + strategy: + matrix: + eslint: [8] + node: ['lts/*'] + os: [ubuntu-latest] + + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules + run: git submodule update --init + - name: Install Node.js v${{ matrix.node }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Install Packages + run: npm install -f + - name: Install ESLint v${{ matrix.eslint }} + run: node scripts/ci-install-eslint ${{ matrix.eslint }} + - name: Test + run: npm run -s test:debug diff --git a/.gitignore b/.gitignore index 80b13514..8bf60fc5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ /.nyc_output /.temp /coverage -/node_modules +node_modules /test/temp /index.* /npm-debug.log /test.js +/test/fixtures/espree-v8/node_modules +/test/fixtures/integrations/**/_actual.json diff --git a/.gitmodules b/.gitmodules index 45ed6b45..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "test/fixtures/eslint"] - path = test/fixtures/eslint - url = https://github.com/eslint/eslint.git diff --git a/.nycrc b/.nycrc new file mode 100644 index 00000000..a31275f2 --- /dev/null +++ b/.nycrc @@ -0,0 +1,19 @@ +{ + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "src/external/**/*.ts" + ], + "extension": [ + ".ts" + ], + "require": [ + "ts-node/register" + ], + "reporter": [ + "lcov", + "text-summary" + ], + "sourceMap": true +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8cb9621d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -sudo: false -language: node_js -node_js: - - "4" - - "6" - - "8" -before_script: - - npm run setup -after_success: - - npm run codecov diff --git a/.vscode/settings.json b/.vscode/settings.json index 0bcb47f3..7ff99747 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,12 @@ { - "eslint.validate": [ - "javascript", - {"language": "html", "autoFix": true}, - {"language": "vue", "autoFix": true}, - {"language": "typescript", "autoFix": true} - ] + "typescript.tsdk": "node_modules/typescript/lib", + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "json", + "jsonc" + ] } diff --git a/README.md b/README.md index 80b5fcfc..57e0668f 100644 --- a/README.md +++ b/README.md @@ -2,97 +2,298 @@ [![npm version](https://img.shields.io/npm/v/vue-eslint-parser.svg)](https://www.npmjs.com/package/vue-eslint-parser) [![Downloads/month](https://img.shields.io/npm/dm/vue-eslint-parser.svg)](http://www.npmtrends.com/vue-eslint-parser) -[![Build Status](https://travis-ci.org/mysticatea/vue-eslint-parser.svg?branch=master)](https://travis-ci.org/mysticatea/vue-eslint-parser) -[![Coverage Status](https://codecov.io/gh/mysticatea/vue-eslint-parser/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/vue-eslint-parser) -[![Dependency Status](https://david-dm.org/mysticatea/vue-eslint-parser.svg)](https://david-dm.org/mysticatea/vue-eslint-parser) +[![Build Status](https://github.com/vuejs/vue-eslint-parser/workflows/CI/badge.svg)](https://github.com/vuejs/vue-eslint-parser/actions) The ESLint custom parser for `.vue` files. ## โคด๏ธ Motivation -- **This parser allows us to lint the `