Skip to content

Commit 5e7727c

Browse files
committed
Switch to minimal tseslint config
1 parent 1edab62 commit 5e7727c

File tree

12 files changed

+1146
-5081
lines changed

12 files changed

+1146
-5081
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 236 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ Our full set of linting can be run at any time with:
4646
npm run lint
4747
```
4848

49-
Included in this repository are an [eslint config file](.eslintrc.cjs) as well as an
49+
Included in this repository are an [eslint config file](eslint.config.js) as well as an
5050
[editorconfig file](.editorconfig) to help with ensuring a consistent style in the codebase for the
5151
API server.
5252

5353
To help enforce this, we use both eslint and echint in our testing. To run eslint at any time, which
54-
checks the code style of any JavaScript, you can use:
54+
checks the code style of any TypeScript, you can use:
5555

5656
```sh
5757
npm run lint:eslint
@@ -97,13 +97,6 @@ a valid DSN URL from Sentry. The `SENTRY_RELEASE` environment variable can also
9797
specific release of the worker (our GitHub Actions workflows for deployments set this to the current
9898
commit hash).
9999

100-
Alongside the normal error reporting that Sentry provides in the worker, we also fire out custom
101-
error events for certain issues to help with improving data consistency across cdnjs:
102-
103-
<!-- - `Missing SRI entry` is fired if there is no SRI hash for a file -->
104-
- `Bad entry in Algolia data` is fired if an entry in Algolia is falsey, or if its name is falsey
105-
- `Bad entry in packages data` is fired if a package is falsey, or if its `name`/`version` is falsey
106-
107100
## Deployment
108101

109102
As this API server is written as a Cloudflare Worker, you can deploy it using the Wrangler CLI. This

eslint.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import { defineConfig } from 'eslint/config';
5+
import tseslint from 'typescript-eslint';
6+
import jsdoc from 'eslint-plugin-jsdoc';
7+
8+
export default defineConfig(
9+
eslint.configs.recommended,
10+
tseslint.configs.strict,
11+
tseslint.configs.stylistic,
12+
jsdoc.configs['flat/recommended-typescript'],
13+
{
14+
name: 'custom/jsdoc',
15+
rules: {
16+
'jsdoc/require-returns': 'off',
17+
'jsdoc/tag-lines': [ 'error', 'any', { startLines: 1 } ]
18+
},
19+
},
20+
{
21+
name: 'custom/spec',
22+
files: [ '**/spec/**/*.ts', '**/*.spec.ts' ],
23+
rules: {
24+
'@typescript-eslint/no-unused-expressions': 'off',
25+
'@typescript-eslint/no-non-null-assertion': 'off',
26+
}
27+
},
28+
{
29+
name: 'custom/ignores',
30+
ignores: [ 'dist-worker/**', 'types/worker.d.ts' ],
31+
}
32+
);

0 commit comments

Comments
 (0)