+ );
+}
+\`\`\`
+
+expected no-console error:
+
+\`\`\`js
+function foo() {
+ console.log('test');
+}
+\`\`\`
+
+expected no-explicit-any error:
+expected no-console error:
+
+\`\`\`js
+function foo(): any {
+ console.log('test');
+}
+\`\`\`
+
+expected no-explicit-any error:
+expected no-console error:
+
+\`\`\`javascript
+function foo(): any {
+ console.log('test');
+}
+\`\`\`
+
+expected no-explicit-any error:
+expected no-console error:
+
+\`\`\`node
+function foo(): any {
+ console.log('test');
+}
+\`\`\`
+",
+ "usedDeprecatedRules": Array [],
+ "warningCount": 0,
+ },
+]
+`;
diff --git a/tests/integration/fixtures/markdown/test.sh b/tests/integration/fixtures/markdown/test.sh
index 356156f60f7..9ff7a57b68c 100755
--- a/tests/integration/fixtures/markdown/test.sh
+++ b/tests/integration/fixtures/markdown/test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -exuo pipefail
# Generate the package.json to use
node /usr/utils/generate-package-json.js
@@ -12,7 +13,7 @@ npm install $(npm pack /usr/parser | tail -1)
npm install $(npm pack /usr/experimental-utils | tail -1)
npm install $(npm pack /usr/eslint-plugin | tail -1)
-# Install the latest vue-eslint-parser (this may break us occassionally, but it's probably good to get that feedback early)
+# Install the latest eslint-plugin-markdown (this may break us occassionally, but it's probably good to get that feedback early)
npm install eslint-plugin-markdown@latest
# Run the linting
diff --git a/tests/integration/fixtures/markdown/tsconfig.json b/tests/integration/fixtures/markdown/tsconfig.json
index 45234bf35aa..eb32eba20a3 100644
--- a/tests/integration/fixtures/markdown/tsconfig.json
+++ b/tests/integration/fixtures/markdown/tsconfig.json
@@ -1,6 +1,6 @@
{
- "compilerOptions": {
- "strict": true
- },
- "include": []
+ "compilerOptions": {
+ "strict": true
+ },
+ "include": []
}
diff --git a/tests/integration/fixtures/recommended-does-not-require-program/index.ts b/tests/integration/fixtures/recommended-does-not-require-program/index.ts
index 838b04b9475..cf187492f17 100644
--- a/tests/integration/fixtures/recommended-does-not-require-program/index.ts
+++ b/tests/integration/fixtures/recommended-does-not-require-program/index.ts
@@ -1 +1 @@
-var foo = true
+var foo: any = true;
diff --git a/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap b/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap
new file mode 100644
index 00000000000..b313deb408b
--- /dev/null
+++ b/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap
@@ -0,0 +1,82 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`it should produce the expected lint ouput 1`] = `
+Array [
+ Object {
+ "errorCount": 1,
+ "filePath": "/usr/linked/index.ts",
+ "fixableErrorCount": 1,
+ "fixableWarningCount": 0,
+ "messages": Array [
+ Object {
+ "column": 1,
+ "endColumn": 21,
+ "endLine": 1,
+ "fix": Object {
+ "range": Array [
+ 0,
+ 3,
+ ],
+ "text": "let",
+ },
+ "line": 1,
+ "message": "Unexpected var, use let or const instead.",
+ "messageId": "unexpectedVar",
+ "nodeType": "VariableDeclaration",
+ "ruleId": "no-var",
+ "severity": 2,
+ },
+ Object {
+ "column": 5,
+ "endColumn": 13,
+ "endLine": 1,
+ "line": 1,
+ "message": "'foo' is assigned a value but never used.",
+ "messageId": "unusedVar",
+ "nodeType": "Identifier",
+ "ruleId": "@typescript-eslint/no-unused-vars",
+ "severity": 1,
+ },
+ Object {
+ "column": 10,
+ "endColumn": 13,
+ "endLine": 1,
+ "line": 1,
+ "message": "Unexpected any. Specify a different type.",
+ "messageId": "unexpectedAny",
+ "nodeType": "TSAnyKeyword",
+ "ruleId": "@typescript-eslint/no-explicit-any",
+ "severity": 1,
+ "suggestions": Array [
+ Object {
+ "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.",
+ "fix": Object {
+ "range": Array [
+ 9,
+ 12,
+ ],
+ "text": "unknown",
+ },
+ "messageId": "suggestUnknown",
+ },
+ Object {
+ "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",
+ "fix": Object {
+ "range": Array [
+ 9,
+ 12,
+ ],
+ "text": "never",
+ },
+ "messageId": "suggestNever",
+ },
+ ],
+ },
+ ],
+ "source": "var foo: any = true;
+",
+ "usedDeprecatedRules": Array [],
+ "warningCount": 2,
+ },
+]
+`;
diff --git a/tests/integration/fixtures/recommended-does-not-require-program/test.sh b/tests/integration/fixtures/recommended-does-not-require-program/test.sh
index 9abb264733d..9e9b2a6917b 100755
--- a/tests/integration/fixtures/recommended-does-not-require-program/test.sh
+++ b/tests/integration/fixtures/recommended-does-not-require-program/test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -exuo pipefail
# Generate the package.json to use
node /usr/utils/generate-package-json.js
diff --git a/tests/integration/fixtures/typescript-and-tslint-plugins-together/.eslintrc.js b/tests/integration/fixtures/typescript-and-tslint-plugins-together/.eslintrc.js
index 3caad1ed427..0409a42c42b 100644
--- a/tests/integration/fixtures/typescript-and-tslint-plugins-together/.eslintrc.js
+++ b/tests/integration/fixtures/typescript-and-tslint-plugins-together/.eslintrc.js
@@ -1,38 +1,33 @@
module.exports = {
- "root": true,
+ root: true,
// Local version of @typescript-eslint/parser
- "parser": "@typescript-eslint/parser",
- "plugins": [
- // Local version of @typescript-eslint/eslint-plugin
- "@typescript-eslint",
- // Local version of @typescript-eslint/eslint-plugin-tslint
- "@typescript-eslint/tslint"
+ parser: '@typescript-eslint/parser',
+ plugins: [
+ // Local version of @typescript-eslint/eslint-plugin
+ '@typescript-eslint',
+ // Local version of @typescript-eslint/eslint-plugin-tslint
+ '@typescript-eslint/tslint',
],
- "env": {
- "es6": true,
- "node": true
+ env: {
+ es6: true,
+ node: true,
},
- "extends": [
- "plugin:@typescript-eslint/recommended"
- ],
- "parserOptions": {
- "sourceType": "module",
- "ecmaFeatures": {
- "jsx": false
- },
- "project": "/usr/linked/tsconfig.json"
+ extends: ['plugin:@typescript-eslint/recommended'],
+ parserOptions: {
+ sourceType: 'module',
+ ecmaFeatures: {
+ jsx: false,
+ },
+ project: '/usr/linked/tsconfig.json',
+ },
+ rules: {
+ '@typescript-eslint/tslint/config': [
+ 'error',
+ {
+ rules: {
+ semicolon: [true, 'always'],
+ },
+ },
+ ],
},
- "rules": {
- "@typescript-eslint/tslint/config": [
- "error",
- {
- "rules": {
- "semicolon": [
- true,
- "always"
- ]
- }
- }
- ]
- }
-}
+};
diff --git a/tests/integration/fixtures/typescript-and-tslint-plugins-together/index.ts b/tests/integration/fixtures/typescript-and-tslint-plugins-together/index.ts
index 9c39b2d32a7..8812117dbb2 100644
--- a/tests/integration/fixtures/typescript-and-tslint-plugins-together/index.ts
+++ b/tests/integration/fixtures/typescript-and-tslint-plugins-together/index.ts
@@ -1 +1,2 @@
+// prettier-ignore
const noSemi = true
diff --git a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap
index 26482bf124b..23e113677cc 100644
--- a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap
+++ b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap
@@ -11,8 +11,8 @@ Array [
Object {
"column": 7,
"endColumn": 13,
- "endLine": 1,
- "line": 1,
+ "endLine": 2,
+ "line": 2,
"message": "'noSemi' is assigned a value but never used.",
"messageId": "unusedVar",
"nodeType": "Identifier",
@@ -22,15 +22,15 @@ Array [
Object {
"column": 20,
"endColumn": 20,
- "endLine": 1,
+ "endLine": 2,
"fix": Object {
"range": Array [
- 19,
- 19,
+ 38,
+ 38,
],
"text": ";",
},
- "line": 1,
+ "line": 2,
"message": "Missing semicolon (tslint:semicolon)",
"messageId": "failure",
"nodeType": null,
@@ -38,7 +38,8 @@ Array [
"severity": 2,
},
],
- "source": "const noSemi = true
+ "source": "// prettier-ignore
+const noSemi = true
",
"usedDeprecatedRules": Array [],
"warningCount": 1,
diff --git a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.sh b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.sh
index b634d531d5e..7afab784b6c 100755
--- a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.sh
+++ b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -exuo pipefail
# Generate the package.json to use
node /usr/utils/generate-package-json.js
diff --git a/tests/integration/fixtures/typescript-and-tslint-plugins-together/tsconfig.json b/tests/integration/fixtures/typescript-and-tslint-plugins-together/tsconfig.json
index 86423f3e4aa..aee0ec940fc 100644
--- a/tests/integration/fixtures/typescript-and-tslint-plugins-together/tsconfig.json
+++ b/tests/integration/fixtures/typescript-and-tslint-plugins-together/tsconfig.json
@@ -1,5 +1,5 @@
{
- "compilerOptions": {
- "strict": true
- }
-}
\ No newline at end of file
+ "compilerOptions": {
+ "strict": true
+ }
+}
diff --git a/tests/integration/fixtures/vue-jsx/.eslintrc.js b/tests/integration/fixtures/vue-jsx/.eslintrc.js
index c9d88fd01e9..0881ee92835 100644
--- a/tests/integration/fixtures/vue-jsx/.eslintrc.js
+++ b/tests/integration/fixtures/vue-jsx/.eslintrc.js
@@ -5,9 +5,7 @@ module.exports = {
es6: true,
node: true,
},
- extends: [
- 'plugin:vue/essential',
- ],
+ extends: ['plugin:vue/essential'],
parserOptions: {
// Local version of @typescript-eslint/parser
parser: '@typescript-eslint/parser',
diff --git a/tests/integration/fixtures/vue-jsx/test.js.snap b/tests/integration/fixtures/vue-jsx/test.js.snap
new file mode 100644
index 00000000000..23764ebfea9
--- /dev/null
+++ b/tests/integration/fixtures/vue-jsx/test.js.snap
@@ -0,0 +1,88 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`it should produce the expected lint ouput 1`] = `
+Array [
+ Object {
+ "errorCount": 1,
+ "filePath": "/usr/linked/Jsx.vue",
+ "fixableErrorCount": 0,
+ "fixableWarningCount": 0,
+ "messages": Array [
+ Object {
+ "column": 17,
+ "endColumn": 20,
+ "endLine": 17,
+ "line": 17,
+ "message": "Unexpected any. Specify a different type.",
+ "messageId": "unexpectedAny",
+ "nodeType": "TSAnyKeyword",
+ "ruleId": "@typescript-eslint/no-explicit-any",
+ "severity": 2,
+ "suggestions": Array [
+ Object {
+ "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.",
+ "fix": Object {
+ "range": Array [
+ 390,
+ 393,
+ ],
+ "text": "unknown",
+ },
+ "messageId": "suggestUnknown",
+ },
+ Object {
+ "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",
+ "fix": Object {
+ "range": Array [
+ 390,
+ 393,
+ ],
+ "text": "never",
+ },
+ "messageId": "suggestNever",
+ },
+ ],
+ },
+ ],
+ "source": "
+",
+ "usedDeprecatedRules": Array [],
+ "warningCount": 0,
+ },
+]
+`;
diff --git a/tests/integration/fixtures/vue-jsx/test.sh b/tests/integration/fixtures/vue-jsx/test.sh
index a484c2625e7..7e03aa3dc15 100755
--- a/tests/integration/fixtures/vue-jsx/test.sh
+++ b/tests/integration/fixtures/vue-jsx/test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -exuo pipefail
# Generate the package.json to use
node /usr/utils/generate-package-json.js
@@ -12,15 +13,10 @@ npm install $(npm pack /usr/parser | tail -1)
npm install $(npm pack /usr/experimental-utils | tail -1)
npm install $(npm pack /usr/eslint-plugin | tail -1)
-# Install the latest vue-eslint-parser (this may break us occassionally, but it's probably good to get that feedback early)
-npm install vue-eslint-parser@latest
-
-# Install the latest eslint-plugin-vue (this may break us occassionally, but it's probably good to get that feedback early)
-npm install eslint-plugin-vue@latest
-
+# Install the latest versions of dependencies (this may break us occassionally, but it's probably good to get that feedback early)
+npm install vue-eslint-parser@latest eslint-plugin-vue@latest
# Install the latest some other vue utilities
-npm install vuex@latest
-npm install vue-property-decorator@latest
+npm install vuex@latest vue-property-decorator@latest
# Run the linting
# (the "|| true" helps make sure that we run our tests on failed linting runs as well)
diff --git a/tests/integration/fixtures/vue-jsx/tsconfig.json b/tests/integration/fixtures/vue-jsx/tsconfig.json
index 861b7d99bed..f49818af019 100644
--- a/tests/integration/fixtures/vue-jsx/tsconfig.json
+++ b/tests/integration/fixtures/vue-jsx/tsconfig.json
@@ -1,8 +1,6 @@
{
- "compilerOptions": {
- "strict": true
- },
- "include": [
- "*.vue"
- ]
+ "compilerOptions": {
+ "strict": true
+ },
+ "include": ["*.vue"]
}
diff --git a/tests/integration/fixtures/vue-sfc/.eslintrc.js b/tests/integration/fixtures/vue-sfc/.eslintrc.js
index 7be44347c59..2fd3c51e7c2 100644
--- a/tests/integration/fixtures/vue-sfc/.eslintrc.js
+++ b/tests/integration/fixtures/vue-sfc/.eslintrc.js
@@ -5,9 +5,7 @@ module.exports = {
es6: true,
node: true,
},
- extends: [
- 'plugin:vue/essential',
- ],
+ extends: ['plugin:vue/essential'],
parserOptions: {
// Local version of @typescript-eslint/parser
parser: '@typescript-eslint/parser',
diff --git a/tests/integration/fixtures/vue-sfc/test.js.snap b/tests/integration/fixtures/vue-sfc/test.js.snap
new file mode 100644
index 00000000000..755700fe36b
--- /dev/null
+++ b/tests/integration/fixtures/vue-sfc/test.js.snap
@@ -0,0 +1,97 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`it should produce the expected lint ouput 1`] = `
+Array [
+ Object {
+ "errorCount": 1,
+ "filePath": "/usr/linked/Hello.vue",
+ "fixableErrorCount": 0,
+ "fixableWarningCount": 0,
+ "messages": Array [
+ Object {
+ "column": 29,
+ "endColumn": 32,
+ "endLine": 31,
+ "line": 31,
+ "message": "Unexpected any. Specify a different type.",
+ "messageId": "unexpectedAny",
+ "nodeType": "TSAnyKeyword",
+ "ruleId": "@typescript-eslint/no-explicit-any",
+ "severity": 2,
+ "suggestions": Array [
+ Object {
+ "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.",
+ "fix": Object {
+ "range": Array [
+ 708,
+ 711,
+ ],
+ "text": "unknown",
+ },
+ "messageId": "suggestUnknown",
+ },
+ Object {
+ "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",
+ "fix": Object {
+ "range": Array [
+ 708,
+ 711,
+ ],
+ "text": "never",
+ },
+ "messageId": "suggestNever",
+ },
+ ],
+ },
+ ],
+ "source": "
+
+
+
+
+ Hello {{ (name as any) }}{{exclamationMarks}}
+
+
+
+
+
+
+
+",
+ "usedDeprecatedRules": Array [],
+ "warningCount": 0,
+ },
+ Object {
+ "errorCount": 0,
+ "filePath": "/usr/linked/World.vue",
+ "fixableErrorCount": 0,
+ "fixableWarningCount": 0,
+ "messages": Array [],
+ "usedDeprecatedRules": Array [],
+ "warningCount": 0,
+ },
+]
+`;
diff --git a/tests/integration/fixtures/vue-sfc/test.sh b/tests/integration/fixtures/vue-sfc/test.sh
index a484c2625e7..7e03aa3dc15 100755
--- a/tests/integration/fixtures/vue-sfc/test.sh
+++ b/tests/integration/fixtures/vue-sfc/test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -exuo pipefail
# Generate the package.json to use
node /usr/utils/generate-package-json.js
@@ -12,15 +13,10 @@ npm install $(npm pack /usr/parser | tail -1)
npm install $(npm pack /usr/experimental-utils | tail -1)
npm install $(npm pack /usr/eslint-plugin | tail -1)
-# Install the latest vue-eslint-parser (this may break us occassionally, but it's probably good to get that feedback early)
-npm install vue-eslint-parser@latest
-
-# Install the latest eslint-plugin-vue (this may break us occassionally, but it's probably good to get that feedback early)
-npm install eslint-plugin-vue@latest
-
+# Install the latest versions of dependencies (this may break us occassionally, but it's probably good to get that feedback early)
+npm install vue-eslint-parser@latest eslint-plugin-vue@latest
# Install the latest some other vue utilities
-npm install vuex@latest
-npm install vue-property-decorator@latest
+npm install vuex@latest vue-property-decorator@latest
# Run the linting
# (the "|| true" helps make sure that we run our tests on failed linting runs as well)
diff --git a/tests/integration/fixtures/vue-sfc/tsconfig.json b/tests/integration/fixtures/vue-sfc/tsconfig.json
index 861b7d99bed..f49818af019 100644
--- a/tests/integration/fixtures/vue-sfc/tsconfig.json
+++ b/tests/integration/fixtures/vue-sfc/tsconfig.json
@@ -1,8 +1,6 @@
{
- "compilerOptions": {
- "strict": true
- },
- "include": [
- "*.vue"
- ]
+ "compilerOptions": {
+ "strict": true
+ },
+ "include": ["*.vue"]
}
diff --git a/tests/integration/run-all-tests.sh b/tests/integration/run-all-tests.sh
index 8964e319869..eccb4e2e157 100755
--- a/tests/integration/run-all-tests.sh
+++ b/tests/integration/run-all-tests.sh
@@ -1,5 +1,5 @@
-# Ensure child script failures are propagated
-set -e
+#!/bin/bash
+set -exuo pipefail
# We run the services serially and in a non-detached state just that we can ensure predictable
# exit codes for all of our integration tests, and we can ensure CI builds pass or fail appropriately
@@ -18,3 +18,6 @@ docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-con
# markdown
docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit markdown
+
+# eslint-v6
+docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit eslint-v6
diff --git a/tests/performance/fixtures/lint-real-repo/install-local-packages.sh b/tests/performance/fixtures/lint-real-repo/install-local-packages.sh
index f38459f3455..0807e303b89 100755
--- a/tests/performance/fixtures/lint-real-repo/install-local-packages.sh
+++ b/tests/performance/fixtures/lint-real-repo/install-local-packages.sh
@@ -1,3 +1,6 @@
+#!/bin/bash
+set -exuo pipefail
+
# This script should be run by attaching a shell to the running docker
# container, and then running `../linked/install-local-packages.sh` from
# that shell.