-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Feat #38 - Add typescript Eslint plugins & .eslintrc.js
- Loading branch information
1 parent
1a86b54
commit 5b70e24
Showing
13 changed files
with
492 additions
and
273 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,68 @@ | ||
module.exports = { | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:@typescript-eslint/recommended' // Uses the recommended rules from the @typescript-eslint/eslint-plugin | ||
], | ||
globals: { | ||
console: true, | ||
localStorage: true, | ||
module: true, | ||
window: true | ||
}, | ||
parser: '@typescript-eslint/parser', // Specifies the ESLint parser | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
modules: true | ||
}, | ||
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features | ||
sourceType: 'module', // Allows for the use of imports | ||
project: './tsconfig.json' | ||
}, | ||
plugins: ['react', '@typescript-eslint'], | ||
rules: { | ||
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs | ||
// e.g. "@typescript-eslint/explicit-function-return-type": "off", | ||
'@typescript-eslint/ban-types': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-extra-semi': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars-experimental': 'warn', | ||
'comma-dangle': ['warn', 'never'], | ||
'comma-spacing': ['warn', { after: true, before: false }], | ||
'key-spacing': [ | ||
'warn', | ||
{ | ||
afterColon: true, | ||
beforeColon: false | ||
} | ||
], | ||
'no-duplicate-imports': 'error', | ||
'no-useless-computed-key': 'warn', | ||
'quote-props': ['warn', 'as-needed'], | ||
quotes: ['warn', 'single'], | ||
'react/display-name': 'off', | ||
'react/jsx-sort-props': 'warn', | ||
semi: ['warn', 'never'], | ||
'semi-spacing': ['warn', { after: true, before: false }], | ||
'sort-imports': [ | ||
'warn', | ||
{ | ||
ignoreCase: true, | ||
ignoreMemberSort: false, | ||
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'] | ||
} | ||
], | ||
'sort-keys': ['warn', 'asc'], | ||
'space-in-parens': ['warn', 'never'] | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect' | ||
} | ||
} | ||
} |
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,25 @@ | ||
name: Node.js CI | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
always-auth: true | ||
node-version: '12.x' | ||
registry-url: https://npm.pkg.github.com/ | ||
scope: '@dassana-io' | ||
- name: Run install, lint, test, and build | ||
run: | | ||
npm install | ||
npm run lint | ||
npm test | ||
npm run build | ||
env: | ||
CI: true |
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
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,6 @@ | ||
module.exports = { | ||
collectCoverageFrom: ['lib/**/*.{ts,tsx,js,jsx}'], | ||
coverageDirectory: 'coverage', | ||
preset: 'ts-jest', | ||
testEnvironment: 'node' | ||
} |
Oops, something went wrong.