Skip to content

Fix: upgrade vue-eslint-parser #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.nyc_output
/coverage
/tests/integrations/*/node_modules
/node_modules
/test.*
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.tabSize": 2
}
4 changes: 3 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/index.js",
"scripts": {
"start": "npm run test:simple -- --watch --growl",
"test:base": "mocha tests --recursive",
"test:base": "mocha \"tests/lib/**/*.js\" \"tests/integrations/*.js\" --timeout 60000",
"test:simple": "npm run test:base -- --reporter nyan",
"test": "nyc npm run test:base",
"lint": "eslint .",
Expand Down Expand Up @@ -45,7 +45,7 @@
},
"dependencies": {
"requireindex": "^1.1.0",
"vue-eslint-parser": "mysticatea/vue-eslint-parser#v1.1.0-4"
"vue-eslint-parser": "^1.1.0-6"
},
"devDependencies": {
"@types/node": "^4.2.6",
Expand Down
5 changes: 5 additions & 0 deletions tests/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"env": {
"mocha": true
}
}
34 changes: 34 additions & 0 deletions tests/integrations/eslint-plugin-import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
'use strict'

// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------

const cp = require('child_process')
const path = require('path')

// -----------------------------------------------------------------------------
// Tests
// -----------------------------------------------------------------------------

describe('Integration with eslint-plugin-import', () => {
let originalCwd

before(() => {
originalCwd = process.cwd()
process.chdir(path.join(__dirname, 'eslint-plugin-import'))
cp.execSync('npm i', { stdio: 'inherit', env: { npm_config_package_lock: 'false' }})
})
after(() => {
process.chdir(originalCwd)
})

it('should lint without errors', () => {
cp.execSync(`.${path.sep}node_modules${path.sep}.bin${path.sep}eslint a.vue`, { stdio: 'inherit' })
})
})
22 changes: 22 additions & 0 deletions tests/integrations/eslint-plugin-import/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"root": true,
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2015
},
"parser": "vue-eslint-parser",
"plugins": [
"import",
"vue"
],
"rules": {
"import/default": "warn",
"import/namespace": "warn"
},
"settings": {
"import/extensions": [
".js",
".vue"
]
}
}
10 changes: 10 additions & 0 deletions tests/integrations/eslint-plugin-import/a.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<b></b>
</template>

<script>
import B from "./b.vue"
export default {
components: {B}
}
</script>
7 changes: 7 additions & 0 deletions tests/integrations/eslint-plugin-import/b.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div>Hello</div>
</template>

<script>
export default {}
</script>
15 changes: 15 additions & 0 deletions tests/integrations/eslint-plugin-import/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"private": true,
"name": "integration-test-for-eslint-plugin-import",
"version": "1.0.0",
"description": "Integration test for eslint-plugin-import",
"scripts": {},
"keywords": [],
"author": "Toru Nagashima (https://github.com/mysticatea)",
"license": "MIT",
"dependencies": {
"eslint": "~3.19.0",
"eslint-plugin-import": "~2.3.0",
"eslint-plugin-vue": "file:..\\..\\.."
}
}
4 changes: 4 additions & 0 deletions tests/lib/rules/no-invalid-template-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ tester.run('no-invalid-template-root', rule, {
{
filename: 'test.vue',
code: '<template>\n <!-- comment -->\n <div v-if="foo">abc</div>\n <div v-else-if="bar">abc</div>\n <div v-else>abc</div>\n</template>'
},
{
filename: 'test.vue',
code: `<template>\n <c1 v-if="1" />\n <c2 v-else-if="1" />\n <c3 v-else />\n</template>`
}
],
invalid: [
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/rules/no-invalid-v-else-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ tester.run('no-invalid-v-else-if', rule, {
{
filename: 'test.vue',
code: '<template><div><div v-if="foo"></div><div v-else-if="foo"></div><div v-else-if="foo"></div></div></template>'
},
{
filename: 'test.vue',
code: `<template>\n <c1 v-if="1" />\n <c2 v-else-if="1" />\n <c3 v-else />\n</template>`
}
],
invalid: [
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/rules/no-invalid-v-else.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ tester.run('no-invalid-v-else', rule, {
{
filename: 'test.vue',
code: '<template><div><div v-if="foo"></div><div v-else-if="foo"></div><div v-else></div></div></template>'
},
{
filename: 'test.vue',
code: `<template>\n <c1 v-if="1" />\n <c2 v-else-if="1" />\n <c3 v-else />\n</template>`
}
],
invalid: [
Expand Down