Skip to content

Commit

Permalink
Small step to prepare for native node glob support, and test waters o…
Browse files Browse the repository at this point in the history
…f dep hygiene
  • Loading branch information
jdalton committed Aug 20, 2024
1 parent fc3f2aa commit cbbe339
Show file tree
Hide file tree
Showing 9 changed files with 681 additions and 1,625 deletions.
4 changes: 4 additions & 0 deletions .config/rollup.base.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import replace from '@rollup/plugin-replace'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import rangesIntersect from 'semver/ranges/intersects.js'
import { readPackageUpSync } from 'read-package-up'
import { purgePolyfills } from 'unplugin-purge-polyfills'

import { loadJSON } from '../scripts/files.js'
import {
Expand Down Expand Up @@ -137,6 +138,9 @@ export default (extendConfig = {}) => {
babelConfig,
tsconfig: tsconfigPath
}),
purgePolyfills.rollup({
replacements: {}
}),
// Convert un-prefixed built-in imports into "node:"" prefixed forms.
replace({
delimiters: ['(?<=(?:require\\(|from\\s*)["\'])', '(?=["\'])'],
Expand Down
18 changes: 8 additions & 10 deletions .dep-stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"chalk-table": "^1.0.2",
"hpagent": "^1.2.0",
"ignore": "^5.3.1",
"ignore-by-default": "^2.1.0",
"pacote": "^18.0.6",
"pony-cause": "^2.1.11",
"synp": "^1.9.13",
Expand All @@ -31,15 +30,15 @@
"default-browser": "^5.2.1",
"default-browser-id": "^5.0.0",
"define-lazy-prop": "^3.0.0",
"dot-prop": "^6.0.1",
"dot-prop": "^9.0.0",
"escape-goat": "^4.0.0",
"execa": "^9.3.0",
"figures": "^6.1.0",
"get-east-asian-width": "^1.0.0",
"get-stream": "^9.0.0",
"global-directory": "^4.0.1",
"globby": "^14.0.2",
"human-signals": "^7.0.0",
"human-signals": "^8.0.0",
"is-docker": "^3.0.0",
"is-in-ci": "^1.0.0",
"is-inside-container": "^1.0.0",
Expand Down Expand Up @@ -94,15 +93,14 @@
"cli-boxes": "^3.0.0",
"cli-spinners": "^2.9.2",
"cross-spawn": "^7.0.3",
"dot-prop": "^6.0.1",
"dot-prop": "^9.0.0",
"eastasianwidth": "^0.2.0",
"emoji-regex": "^10.3.0",
"fast-glob": "^3.3.2",
"graceful-fs": "^4.2.6",
"hpagent": "^1.2.0",
"ignore": "^5.3.1",
"ignore-by-default": "^2.1.0",
"ini": "4.1.1",
"ini": "4.1.3",
"onetime": "^5.1.0",
"pacote": "^18.0.6",
"pony-cause": "^2.1.11",
Expand All @@ -113,26 +111,26 @@
"supports-hyperlinks": "^2.2.0",
"synp": "^1.9.13",
"which": "^4.0.0",
"write-file-atomic": "^3.0.3",
"write-file-atomic": "^5.0.1",
"yargs-parser": "^21.1.1"
},
"transitives": {
"ansi-align": "^3.0.1",
"cli-boxes": "^3.0.0",
"cli-spinners": "^2.9.2",
"cross-spawn": "^7.0.3",
"dot-prop": "^6.0.1",
"dot-prop": "^9.0.0",
"eastasianwidth": "^0.2.0",
"emoji-regex": "^10.3.0",
"fast-glob": "^3.3.2",
"graceful-fs": "^4.2.6",
"ini": "4.1.1",
"ini": "4.1.3",
"onetime": "^5.1.0",
"rc": "1.2.8",
"registry-auth-token": "^5.0.2",
"semver": "^7.6.2",
"signal-exit": "^4.1.0",
"supports-hyperlinks": "^2.2.0",
"write-file-atomic": "^3.0.3"
"write-file-atomic": "^5.0.1"
}
}
21 changes: 16 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ const { ignores } = includeIgnoreFile(path.join(__dirname, '.gitignore'))

module.exports = {
ignorePatterns: ignores,
extends: ['@socketsecurity', 'plugin:import/typescript', 'prettier'],
extends: [
'@socketsecurity',
'plugin:import/typescript',
'plugin:depend/recommended',
'prettier'
],
parserOptions: {
project: ['./tsconfig.json'],
EXPERIMENTAL_useProjectService: {
Expand All @@ -20,11 +25,10 @@ module.exports = {
'@typescript-eslint/no-floating-promises': [
'error',
{
ignoreVoid: true,
ignoreIIFE: true
ignoreIIFE: true,
ignoreVoid: true
}
],
'no-warning-comments': ['warn', { terms: ['fixme'] }],
// Returning unawaited promises in a try/catch/finally is dangerous
// (the `catch` won't catch if the promise is rejected, and the `finally`
// won't wait for the promise to resolve). Returning unawaited promises
Expand All @@ -33,6 +37,13 @@ module.exports = {
// not awaiting promises *outside* of try/catch/finally, which is not what
// we want), and it's nice to await before returning anyways, since you get
// a slightly more comprehensive stack trace upon promise rejection.
'@typescript-eslint/return-await': ['error', 'always']
'@typescript-eslint/return-await': ['error', 'always'],
'depend/ban-dependencies': [
'warn',
{
allowed: ['globby']
}
],
'no-warning-comments': ['warn', { terms: ['fixme'] }]
}
}
Loading

0 comments on commit cbbe339

Please sign in to comment.