Skip to content

Commit

Permalink
Add lint (#301)
Browse files Browse the repository at this point in the history
* Add linter

* Ran linter

* Finish Linters

* Update LogEvent.test.ts

* Add lint to GH Action

* Add Eslint Dep

* Add Eslint Dep

* Update StatsigClient.ts
  • Loading branch information
daniel-statsig authored May 23, 2023
1 parent 67aaab0 commit 72197ca
Show file tree
Hide file tree
Showing 45 changed files with 2,302 additions and 320 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist
Promise.finally.ts
Object.fromEntries.ts

# Disabled tests folder for now
__tests__
34 changes: 34 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
overrides: [
// Tests
{
files: ['**/*.test.ts'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
},
},

// Main
{
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
files: ['**/*.ts'],
rules: {
'@typescript-eslint/no-floating-promises': [
'error',
{ ignoreVoid: false },
],
},
},
],
};
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@ jobs:
with:
path: ~/.npm
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run build:dryrun

- name: Install
run: npm install

- name: Lint
run: npm run lint

- name: Build
run: npm run build:dryrun
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
with:
path: ~/.npm
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm install
- run: npm run testForGithubOrRedisEnthusiasts
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

.eslintcache

### VSCode

.vscode
Expand Down
Loading

0 comments on commit 72197ca

Please sign in to comment.