Skip to content

Commit

Permalink
Merge branch 'eslint-flat-config'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Mar 6, 2024
2 parents b74e32d + ab154a9 commit 8b580ce
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 57 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ jobs:
wasm:
name: Wasm
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playground
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -74,11 +77,13 @@ jobs:
path: ./playground/node_modules
key: ${{ hashFiles('./playground/package.json') }}
- name: Build playground
run: cd ./playground && make build
run: make build
- name: Lint playground
run: cd ./playground && npm run lint
run: npm run lint
- name: Run tests for wasm
run: cd ./playground && npm test
run: npm test
- name: Check eslint config
run: npx tsc --checkJs --noEmit --module nodenext --strict eslint.config.mjs
lint:
name: Lint
runs-on: ubuntu-latest
Expand Down
51 changes: 0 additions & 51 deletions playground/.eslintrc.json

This file was deleted.

37 changes: 37 additions & 0 deletions playground/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// @ts-check

import eslint from '@eslint/js';
import ts from 'typescript-eslint';

export default ts.config(
eslint.configs.recommended,
...ts.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['index.ts', 'test.ts'],
rules: {
indent: ['error', 4],
quotes: ['error', 'single'],
'linebreak-style': ['error', 'unix'],
semi: ['error', 'always'],
eqeqeq: ['error', 'always'],
'no-constant-condition': ['error', { checkLoops: false }],
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
},
},
{
files: ['test.ts'],
rules: {
'@typescript-eslint/unbound-method': 'off', // For checking `window.runActionlint`
},
}
);
1 change: 1 addition & 0 deletions playground/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ jobs:
}
});

// eslint-disable-next-line @typescript-eslint/no-misused-promises
checkUrlButton.addEventListener('click', async e => {
e.preventDefault();
const input = checkUrlInput.value;
Expand Down
6 changes: 3 additions & 3 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
"devDependencies": {
"@peculiar/webcrypto": "^1.4.5",
"@types/codemirror": "^5.60.15",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.11.24",
"@types/pako": "^2.0.3",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"eslint": "^8.57.0",
"http-server": "^14.1.1",
"prettier": "^3.2.5",
"stylelint": "^16.2.1",
"stylelint-config-standard": "^36.0.0",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"typescript-eslint": "^7.1.1"
}
}
3 changes: 3 additions & 0 deletions playground/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
const go = new Go();
const bin = await fs.readFile('./main.wasm');
const result = await WebAssembly.instantiate(bin, go.importObject);

// Do not `await` this method call since it will never be settled
// eslint-disable-next-line @typescript-eslint/no-floating-promises
go.run(result.instance);
});

Expand Down

0 comments on commit 8b580ce

Please sign in to comment.