-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to TypeScript and [email protected]
- Loading branch information
1 parent
f8459b8
commit 5633fa0
Showing
14 changed files
with
4,275 additions
and
4,232 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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"next/babel", | ||
"stage-0" | ||
"next/babel" | ||
], | ||
"plugins": [ | ||
[ | ||
|
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,2 @@ | ||
/.next | ||
!.eslintrc.js |
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,88 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.json'); | ||
const typescriptEslintPrettier = require('eslint-config-prettier/@typescript-eslint'); | ||
|
||
module.exports = { | ||
env: { | ||
node: true, | ||
}, | ||
parser: 'babel-eslint', | ||
extends: [ | ||
'airbnb', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
'prettier/react', | ||
'prettier/@typescript-eslint', | ||
], | ||
plugins: ['prettier'], | ||
rules: { | ||
'prettier/prettier': 'error', | ||
'react/jsx-filename-extension': 'off', | ||
'jsx-a11y/label-has-for': [ | ||
2, | ||
{ | ||
components: ['Label'], | ||
required: { | ||
some: ['nesting', 'id'], | ||
}, | ||
allowChildren: true, | ||
}, | ||
], | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: ['.eslintrc.js', '**/__tests__/**/*', 'setupTest.ts'], | ||
}, | ||
], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
devDependencies: ['.eslintrc.js', '**/__tests__/**/*'], | ||
}, | ||
], | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.ts', '.tsx'], | ||
}, | ||
}, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
parser: '@typescript-eslint/parser', | ||
// NOTE: Workaround for no nested extends possible. | ||
// See https://github.com/eslint/eslint/issues/8813. | ||
// Working solution would be following, if we had nested extends: | ||
// ``` | ||
// extends: [ | ||
// 'airbnb-base', | ||
// 'plugin:@typescript-eslint/recommended', | ||
// 'prettier/@typescript-eslint', | ||
// 'prettier', | ||
// ], | ||
// ``` | ||
plugins: ['@typescript-eslint', 'prettier'], | ||
rules: Object.assign( | ||
typescriptEslintRecommended.rules, | ||
typescriptEslintPrettier.rules, | ||
{ | ||
'@typescript-eslint/explicit-function-return-type': 'error', | ||
}, | ||
), | ||
}, | ||
{ | ||
files: [ | ||
'setupTest.js', | ||
'setupTest.ts', | ||
'*.spec.js', | ||
'*.spec.ts', | ||
'*.spec.tsx', | ||
], | ||
env: { | ||
jest: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.next | ||
!.eslintrc.js |
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,4 @@ | ||
module.exports = { | ||
trailingComma: 'all', | ||
singleQuote: 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,3 @@ | ||
/* eslint-disable spaced-comment */ | ||
/// <reference types="next" /> | ||
/// <reference types="next/types/global" /> |
Oops, something went wrong.