Skip to content

Commit b387ef8

Browse files
jonkoopsrolandjitsu
authored andcommitted
chore: replace TSLint with ESLint and typescript-eslint
Signed-off-by: Jon Koops <[email protected]>
1 parent 967768e commit b387ef8

File tree

9 files changed

+1270
-264
lines changed

9 files changed

+1270
-264
lines changed

.github/workflows/test.yml renamed to .github/workflows/main.yml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: CI
22
on:
33
push:
44
branches:
@@ -9,13 +9,53 @@ on:
99
types: [opened, synchronize, reopened]
1010

1111
jobs:
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 22
24+
cache: npm
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build
30+
run: npm run build
31+
32+
lint:
33+
name: Lint
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
40+
- name: Setup Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 22
44+
cache: npm
45+
46+
- name: Install dependencies
47+
run: npm ci
48+
49+
- name: Lint
50+
run: npm run lint
51+
1252
test:
13-
name: Run tests on Node.js ${{ matrix.node-version }}
53+
name: Test on Node.js ${{ matrix.node-version }}
1454
runs-on: ubuntu-latest
1555
strategy:
1656
fail-fast: false
1757
matrix:
18-
node_version: [18, 20, 22]
58+
node-version: [18, 20, 22]
1959

2060
steps:
2161
- name: Checkout repository
@@ -25,12 +65,13 @@ jobs:
2565
uses: actions/setup-node@v4
2666
with:
2767
node-version: ${{ matrix.node-version }}
68+
cache: npm
2869

2970
- name: Install dependencies
3071
run: npm ci
3172

3273
- name: Run tests
33-
run: npm run test:cov
74+
run: npm test -- --coverage
3475

3576
- name: Collect coverage
3677
uses: coverallsapp/github-action@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> A small package for converting a [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent) or [file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file) to a list of File objects.
44
55
[![npm](https://img.shields.io/npm/v/file-selector.svg?style=flat-square)](https://www.npmjs.com/package/file-selector)
6-
![Tests](https://img.shields.io/github/actions/workflow/status/react-dropzone/file-selector/test.yml?branch=master&style=flat-square&label=tests)
6+
![CI](https://img.shields.io/github/actions/workflow/status/react-dropzone/file-selector/main.yml?branch=master&style=flat-square&label=CI)
77
[![codecov](https://img.shields.io/coveralls/github/react-dropzone/file-selector/master?style=flat-square)](https://coveralls.io/github/react-dropzone/file-selector?branch=master)
88
[![Open Collective Backers](https://img.shields.io/opencollective/backers/react-dropzone.svg?style=flat-square)](#backers)
99
[![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/react-dropzone.svg?style=flat-square)](#sponsors)

eslint.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
4+
export default tseslint.config(
5+
eslint.configs.recommended,
6+
...tseslint.configs.recommended,
7+
{
8+
rules: {
9+
// TODO: Fix these rule and remove their overrides.
10+
'@typescript-eslint/no-empty-object-type': 'off',
11+
'@typescript-eslint/no-explicit-any': 'off',
12+
}
13+
}
14+
);

0 commit comments

Comments
 (0)