Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: regression for eslint v6 (#2105)
- Loading branch information
1 parent
d262178
commit 31fc503
Showing
32 changed files
with
764 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
root: true, | ||
// Local version of @typescript-eslint/parser | ||
parser: '@typescript-eslint/parser', | ||
plugins: [ | ||
// Local version of @typescript-eslint/eslint-plugin | ||
'@typescript-eslint', | ||
], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'error', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM node:erbium | ||
|
||
# Copy the test.sh into the container. Every other file will be linked, rather | ||
# than copied to allow for changes without rebuilds wherever possible | ||
WORKDIR /usr | ||
COPY ./test.sh /usr/ | ||
|
||
# Create file which will be executed by jest | ||
# to assert that the lint output is what we expect | ||
RUN echo "const actualLintOutput = require('./lint-output.json');\n" \ | ||
"\n" \ | ||
"test('it should produce the expected lint ouput', () => {\n" \ | ||
" expect(actualLintOutput).toMatchSnapshot();\n" \ | ||
"});\n" > test.js | ||
|
||
# Run the integration test | ||
CMD [ "./test.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const noSemi: any = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// 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": 0, | ||
"fixableWarningCount": 0, | ||
"messages": Array [ | ||
Object { | ||
"column": 15, | ||
"endColumn": 18, | ||
"endLine": 1, | ||
"line": 1, | ||
"message": "Unexpected any. Specify a different type.", | ||
"messageId": "unexpectedAny", | ||
"nodeType": "TSAnyKeyword", | ||
"ruleId": "@typescript-eslint/no-explicit-any", | ||
"severity": 2, | ||
}, | ||
], | ||
"source": "const noSemi: any = true; | ||
", | ||
"warningCount": 0, | ||
}, | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -exuo pipefail | ||
|
||
# Generate the package.json to use | ||
node /usr/utils/generate-package-json.js | ||
|
||
# Install dependencies | ||
npm install | ||
npm install eslint@6.0.0 | ||
|
||
# Use the local volumes for our own packages | ||
npm install $(npm pack /usr/typescript-estree | tail -1) | ||
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) | ||
|
||
# Run the linting | ||
# (the "|| true" helps make sure that we run our tests on failed linting runs as well) | ||
npx eslint --format json --output-file /usr/lint-output.json --config /usr/linked/.eslintrc.js /usr/linked/**/*.ts || true | ||
|
||
# Run our assertions against the linting output | ||
npx jest /usr/test.js --snapshotResolver=/usr/utils/jest-snapshot-resolver.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.