Skip to content

Commit a0a6561

Browse files
Merge pull request #127 from ember-tooling/fix-something
test eslint fix && with different ts eslint plugin versions
2 parents 7aeae9c + faa39d2 commit a0a6561

6 files changed

Lines changed: 36 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,19 @@ jobs:
4141
- run: pnpm --filter '*' test
4242

4343
ts_support:
44-
name: "TS: ${{ matrix.tsVersion }}"
44+
name: "TS: ${{ matrix.tsVersion }}, eslint-ts-deps: ${{ matrix.eslintTsVersion }}"
4545
runs-on: ubuntu-latest
4646
needs: [tests]
4747
timeout-minutes: 2
4848
strategy:
4949
fail-fast: false
5050
matrix:
51+
eslintTsVersion:
52+
- ^6
53+
- ^7
54+
- ^8
55+
- canary
5156
tsVersion:
52-
- 5.1
53-
- 5.2
5457
- 5.3
5558
- 5.4
5659
- 5.5
@@ -61,11 +64,21 @@ jobs:
6164
steps:
6265
- uses: actions/checkout@v4
6366
- uses: wyvox/action-setup-pnpm@v3
64-
- name: 'Change TS to ${{ matrix.tsVersion }}'
65-
run: |
66-
tmp=$(mktemp)
67-
jq '.pnpm.overrides.typescript = "${{ matrix.tsVersion }}"' package.json > "$tmp"
68-
mv "$tmp" package.json
67+
- name: 'TS: ${{ matrix.tsVersion }}, eslint-plugin-ts: ${{ matrix.eslintTsVersion }}'
68+
run: |-
69+
function sponge() {
70+
local line;
71+
tmp=$(mktemp)
72+
while IFS= read -r line
73+
do
74+
echo $line >> $tmp;
75+
done
76+
mv "$tmp" $1
77+
}
78+
jq '.pnpm.overrides."@typescript-eslint/parser" = "${{ matrix.eslintTsVersion }}"' package.json | sponge package.json
79+
jq '.pnpm.overrides."@typescript-eslint/scope-manager" = "${{ matrix.eslintTsVersion }}"' package.json | sponge package.json
80+
jq '.pnpm.overrides."@typescript-eslint/visitor-keys" = "${{ matrix.eslintTsVersion }}"' package.json | sponge package.json
81+
jq '.pnpm.overrides.typescript = "${{ matrix.tsVersion }}"' package.json | sponge package.json
6982
- run: pnpm install --no-frozen-lockfile
7083
- run: pnpm test
7184
- run: pnpm --filter '*' test:check

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"optional": true
6666
}
6767
},
68-
"packageManager": "pnpm@10.1.0",
68+
"packageManager": "pnpm@9.15.4",
6969
"engines": {
7070
"node": ">=16.0.0"
7171
},

test-projects/gts/.eslintrc.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ module.exports = {
44
root: true,
55
parserOptions: {
66
project: true,
7+
projectService: true,
78
tsconfigRootDir: __dirname
89
},
910
rules: {
1011
'no-use-before-define': ['error'],
1112
'no-unused-vars': ['error'],
1213
},
1314
overrides: [
15+
{
16+
files: ['src-fixable/**/*'],
17+
rules: {
18+
'arrow-body-style':["error", "always"],
19+
},
20+
},
1421
{
1522
files: ['**/*.{js,ts}'],
1623
plugins: ['ember'],

test-projects/gts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "@test-project/gts",
33
"private": true,
44
"scripts": {
5-
"test:check": "eslint . --max-warnings=0",
6-
"test:fix": "eslint . --fix --max-warnings=0",
5+
"test:check": "eslint src --max-warnings=0",
6+
"test:fix": "eslint ./src-fixable --fix --max-warnings=0",
77
"types": "tsc --noEmit"
88
},
99
"devDependencies": {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
const Bar = x => {return x as unknown};
3+
export default Bar
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const Bar = () => <template></template>;
2+
export default Bar

0 commit comments

Comments
 (0)