This repository has been archived by the owner on Dec 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3ba98f9
Showing
19 changed files
with
7,490 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Jest | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
knip: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "npm" | ||
- name: Install dependencies | ||
run: | | ||
npm install | ||
- name: Run jest | ||
run: | | ||
npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Prettier | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
knip: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "npm" | ||
- name: Install dependencies | ||
run: | | ||
npm install | ||
- name: Run prettier | ||
run: | | ||
npx prettier --check . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: TypeScript Compiler | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
knip: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "npm" | ||
- name: Install dependencies | ||
run: | | ||
npm install | ||
- name: Run tsc | ||
run: | | ||
npx tsc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.prettierrc | ||
jest.config.js | ||
src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"printWidth": 100 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# `eslint-plugin-no-re-export` | ||
|
||
[![npm version](https://badge.fury.io/js/eslint-plugin-no-re-export.svg)](https://badge.fury.io/js/eslint-plugin-no-re-export) | ||
[![Build Status](https://travis-ci.org/azu/eslint-plugin-no-re-export.svg?branch=master)](https://travis-ci.org/azu/eslint-plugin-no-re-export) | ||
|
||
Disallow re-exporting in TypeScript/JavaScript. | ||
|
||
## Installation | ||
|
||
```sh | ||
# npm | ||
npm install eslint-plugin-no-re-export --save-dev | ||
|
||
# yarn | ||
yarn add eslint-plugin-no-re-export --dev | ||
|
||
# bun | ||
bun install eslint-plugin-no-re-export --save-dev | ||
``` | ||
|
||
## Usage | ||
|
||
Add `no-re-export` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: | ||
|
||
```json | ||
{ | ||
"plugins": ["no-re-export"] | ||
} | ||
``` | ||
|
||
Then configure the rules you want to use under the rules section. | ||
|
||
```json | ||
{ | ||
"rules": { | ||
"no-re-export/no-re-export": "error" | ||
} | ||
} | ||
``` | ||
|
||
## Rules | ||
|
||
| Rule ID | Description | | ||
|:--------|:------------| | ||
| [no-re-export](./src/docs/no-re-export.md) | disallow re-exporting in TypeScript/JavaScript | | ||
|
||
## References | ||
|
||
- [Speeding up the JavaScript ecosystem - The barrel file debacle](https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-7/) by @marvinhagemeister | ||
- [Burn the Barrel!](https://uglow.medium.com/burn-the-barrel-c282578f21b6#:~:text=%E2%80%9CThe%20problem%20is%20that%20Jest,like%20%40mui%2Fmaterial%20.%E2%80%9D) by @uglow | ||
- [Your Next.js Bundle Will Thank You](https://renatopozzi.me/articles/your-nextjs-bundle-will-thank-you) by @askides | ||
- [Barrel files in JavaScript](https://flaming.codes/posts/barrel-files-in-javascript) by @flaming-codes | ||
- Comment by @ljharb at [eslint-plugin-import/issues/1920](https://github.com/import-js/eslint-plugin-import/issues/1920) | ||
|
||
> Barrel exports increase bundle size and memory footprint, and are the only reason treeshaking is needed (to only-partially clean up sloppy importing), and in my experience, are best avoided, especially in any codebase of significant scale/size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// @ts-check | ||
|
||
/** @type {import('jest').Config} */ | ||
module.exports = { | ||
projects: [ | ||
{ | ||
moduleDirectories: ["node_modules", "src"], | ||
transform: { | ||
"^.+\\.[jt]sx?$": [ | ||
"esbuild-jest", | ||
{ | ||
sourcemap: true, | ||
}, | ||
], | ||
}, | ||
testEnvironment: "node", | ||
}, | ||
], | ||
clearMocks: true, | ||
restoreMocks: true, | ||
resetMocks: true, | ||
verbose: true, | ||
watchman: false, | ||
}; |
Oops, something went wrong.