-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from alampros/develop
Typescript refactor
- Loading branch information
Showing
20 changed files
with
1,941 additions
and
687 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,65 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'standard', | ||
'standard-react', | ||
], | ||
env: { | ||
browser: true, | ||
node: true, | ||
}, | ||
plugins: [ | ||
'react', | ||
'react-hooks', | ||
], | ||
overrides: [ | ||
{ | ||
files: ['**/*.js'], | ||
parser: 'babel-eslint', | ||
}, | ||
{ | ||
files: ['**/*.ts', '**/*.tsx'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
rules: { | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': ['error', { | ||
vars: 'all', | ||
args: 'after-used', | ||
ignoreRestSiblings: false, | ||
}], | ||
}, | ||
}, | ||
], | ||
rules: { | ||
'no-console': ['warn', { allow: ['warn', 'error'] }], | ||
'quote-props': ['error', 'as-needed'], | ||
'comma-dangle': ['warn', { | ||
arrays: 'only-multiline', | ||
objects: 'always-multiline', | ||
imports: 'only-multiline', | ||
}], | ||
quotes: ['warn', 'single'], | ||
'space-before-function-paren': ['error', { | ||
anonymous: 'never', | ||
named: 'never', | ||
asyncArrow: 'always', | ||
}], | ||
'jsx-quotes': ['error', 'prefer-double'], | ||
'react-hooks/rules-of-hooks': 'error', | ||
'react/jsx-closing-tag-location': 2, | ||
'react/jsx-closing-bracket-location': 2, | ||
'react/jsx-indent': [2, 2, { checkAttributes: true }], | ||
'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }], | ||
'react/prop-types': ['error', { ignore: ['children', 'className', 'style'] }], | ||
'keyword-spacing': ['error', { | ||
overrides: { | ||
if: { after: false }, | ||
for: { after: false }, | ||
while: { after: false }, | ||
catch: { after: false }, | ||
switch: { after: false }, | ||
}, | ||
}], | ||
}, | ||
} |
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
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
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,16 @@ | ||
import { IPoint } from './Point' | ||
|
||
export interface ICircle extends IPoint { | ||
radius: number | ||
} | ||
|
||
export default class Circle implements ICircle { | ||
constructor(init: ICircle) { | ||
this.x = init.x | ||
this.y = init.y | ||
this.radius = init.radius | ||
} | ||
x: number | ||
y: number | ||
radius: number | ||
} |
Oops, something went wrong.