Skip to content

Commit

Permalink
add config for typescript browser
Browse files Browse the repository at this point in the history
  • Loading branch information
wsbrunson committed May 7, 2024
1 parent de4b7a3 commit a279966
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-pens-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@krakenjs/eslint-config-grumbler": minor
---

added eslintrc-typescript-browser config
7 changes: 7 additions & 0 deletions packages/eslint-config-grumbler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ This package assumes you are already using [Prettier](https://prettier.io/).
npm install -D @krakenjs/eslint-config-grumbler
```

### Config Files

- `eslintrc-browser` - browser-based rules + FlowType
- `eslintrc-typescript-browser` - browser-based rules + TypeScript
- `eslintrc-typescript` - TypeScript rules
- `eslintrc-node` - node.js rules

### Usage

1. Create a `.eslintrc.js` file at the root of your package.
Expand Down
37 changes: 37 additions & 0 deletions packages/eslint-config-grumbler/eslintrc-typescript-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* @flow */

// eslint-disable-next-line import/no-commonjs
module.exports = {
extends: "./eslintrc-typescript",

rules: {
"no-process-env": "error",
},

env: {
browser: true,
es6: true,
},

globals: {
window: true,
document: true,
performance: true,
assert: true,

__TEST__: true,
__WEB__: true,
__ENV__: true,
__MIN__: true,
__DEBUG__: true,
__FILE_NAME__: true,
__TREE_SHAKE__: true,
__WINDOW__: true,
__GLOBAL__: true,
__LOCAL__: true,
__STAGE__: true,
__SANDBOX__: true,
__PRODUCTION__: true,
__UID__: true,
},
};

0 comments on commit a279966

Please sign in to comment.