Skip to content

Commit b3397f9

Browse files
authored
chore(deps-dev): upgrade to ESLint 10 (#597)
* chore(deps-dev): upgrade to ESLint 10 and replace eslint-plugin-import with eslint-plugin-import-x eslint-plugin-import does not support ESLint 10 (peer dep caps at ^9). Switch to eslint-plugin-import-x which is the actively maintained fork with ESLint 10 support. - eslint: ^9.39.1 → ^10.0.0 - @eslint/js: ^9.24.0 → ^10.0.0 - eslint-plugin-import → eslint-plugin-import-x (^4.16.2) - eslint-import-resolver-typescript: ^4.3.2 → ^4.4.4 - Update eslint config: import/ rule prefix → import-x/ - Remove redundant resolver settings (provided by pluginImport.typescript) - Fix unnecessary type assertion in cookieJar.ts caught by stricter checks * chore: regenerate API docs for updated api-documenter output
1 parent 37b271e commit b3397f9

6 files changed

Lines changed: 1040 additions & 2958 deletions

api/docs/tough-cookie.getpublicsuffixoptions.allowspecialusedomain.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ If set to `true` then the following [Special Use Domains](https://www.rfc-editor
1212
allowSpecialUseDomain?: boolean | undefined;
1313
```
1414

15+
## Default Value
16+
17+
false
18+
1519
## Remarks
1620

1721
In testing scenarios it's common to configure the cookie store with so that `http://localhost` can be used as a domain:

api/docs/tough-cookie.getpublicsuffixoptions.ignoreerror.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ If set to `true` then any errors that occur while executing [getPublicSuffix()](
1111
```typescript
1212
ignoreError?: boolean | undefined;
1313
```
14+
15+
## Default Value
16+
17+
false
18+

eslint.config.mjs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import eslint from '@eslint/js'
44
import prettierRecommended from 'eslint-plugin-prettier/recommended'
55
import { config, configs } from 'typescript-eslint'
6-
import { flatConfigs as pluginImport } from 'eslint-plugin-import'
6+
import { flatConfigs as pluginImport } from 'eslint-plugin-import-x'
77
import globals from 'globals'
88
import vitest from '@vitest/eslint-plugin'
99

@@ -29,7 +29,7 @@ export default config(
2929
},
3030
rules: {
3131
'@typescript-eslint/explicit-function-return-type': 'error',
32-
'import/no-nodejs-modules': 'error',
32+
'import-x/no-nodejs-modules': 'error',
3333
'no-control-regex': 'off',
3434
},
3535
},
@@ -39,19 +39,11 @@ export default config(
3939
rules: {
4040
...vitest.configs.recommended.rules,
4141
// We only run tests in node, so we can use node's builtins
42-
'import/no-nodejs-modules': 'off',
42+
'import-x/no-nodejs-modules': 'off',
4343
},
4444
},
4545
{
4646
files: ['eslint.config.mjs'],
4747
...configs.disableTypeChecked,
4848
},
49-
{
50-
// other configuration are omitted for brevity
51-
settings: {
52-
'import/resolver': {
53-
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
54-
},
55-
},
56-
},
5749
)

lib/cookie/cookieJar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function getCookieContext(url: unknown): UrlContext {
237237

238238
type SameSiteLevel = keyof (typeof Cookie)['sameSiteLevel']
239239
function checkSameSiteContext(value: string): SameSiteLevel | undefined {
240-
const context = String(value as unknown).toLowerCase()
240+
const context = value.toLowerCase()
241241
if (context === 'none' || context === 'lax' || context === 'strict') {
242242
return context
243243
} else {

0 commit comments

Comments
 (0)