Skip to content

Commit

Permalink
Merge pull request #3 from NullVoxPopuli/fix-glint-leak
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli authored Feb 1, 2024
2 parents 3cdee15 + a4c59ce commit e6ef402
Show file tree
Hide file tree
Showing 13 changed files with 1,086 additions and 25 deletions.
15 changes: 14 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,17 @@
const { configs } = require('@nullvoxpopuli/eslint-configs');

// accommodates: JS, TS, ESM, and CJS
module.exports = configs.node();
const config = configs.node();

module.exports = {
...config,
overrides: [
...config.overrides,
{
files: ['**/*.test.ts'],
rules: {
'n/no-unpublished-import': 'off',
},
},
],
};
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ jobs:
- uses: wyvox/action-setup-pnpm@v3
- name: Lint
run: pnpm lint

test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm test

26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,31 @@ At least one fixer is required to be specified in the second argument.

## Current Fixes

### Removes lines starting with `/// <reference types="ember`
### `/// <reference` removal

See [microsoft/TypeScript#56571](https://github.com/microsoft/TypeScript/issues/56571#issuecomment-1830436576) for details.

You can customize what's removed via:

```js
import { fixBadDeclarationOutput } from "fix-bad-declaration-output";

await fixBadDeclarationOutput(
"./declarations/**/*.d.ts",
[
"TypeScript#56571", // default: type: 'ember'

// remove anything starting with node_modules.
// e.g.: /// <reference type="node_modules/...
["TypeScript#56571", { types: 'node_modules '}],

"Glint#628"
"Glint#697"
]
);
```

#### Removes lines starting with `/// <reference types="ember`

Starting with TS 5.3.x, iirc, ember-source's strategy for shipping public types causes `/// <reference` declarations to be added in libraries.

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"lint:types": "tsc --noEmit",
"prepack": "pnpm build",
"prepare": "pnpm build",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "vitest"
},
"dependencies": {
"fs-extra": "^11.2.0",
Expand All @@ -47,17 +47,20 @@
"@nullvoxpopuli/eslint-configs": "^3.2.2",
"@tsconfig/node21": "^21.0.1",
"@tsconfig/strictest": "^2.0.2",
"@types/common-tags": "^1.8.4",
"@types/fs-extra": "^11.0.4",
"@types/jscodeshift": "^0.11.11",
"@types/node": "^20.11.15",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"common-tags": "^1.8.2",
"concurrently": "^8.2.2",
"eslint": "^8.56.0",
"prettier": "^3.2.4",
"publint": "^0.2.7",
"release-plan": "^0.7.0",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"vitest": "^1.2.2"
},
"publishConfig": {
"access": "public",
Expand Down
Loading

0 comments on commit e6ef402

Please sign in to comment.