Skip to content

Commit

Permalink
[TypeScript] Phase 1 & 2 (Kong#3370)
Browse files Browse the repository at this point in the history
Co-authored-by: Opender Singh <[email protected]>
  • Loading branch information
dimitropoulos and develohpanda authored May 12, 2021
1 parent bdb4b4e commit 5f4c19d
Show file tree
Hide file tree
Showing 1,862 changed files with 136,063 additions and 120,246 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
quote_type = single
5 changes: 2 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ screenshots/
**/.cache/
**/coverage/
**/node_modules/
**/webpack/
**/bin/
**/__fixtures__/
**/fixtures
**/__snapshots__/
**/flow-typed/
**/dist/
**/.cache/
**/svgr/
**/storybook-static/
*.md
*.md
101 changes: 101 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/** @type { import('eslint').Linter.Config } */
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: [
'./tsconfig.eslint.json',
'./packages/*/tsconfig.json',
'./plugins/*/tsconfig.json',
],
tsconfigRootDir: __dirname,
ecmaFeatures: {
jsx: true,
},
},
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'semistandard',
'plugin:react-hooks/recommended',
],
plugins: [
'@typescript-eslint',
'react',
'jest',
'html',
'json',
'filenames',
'react-hooks',
],
globals: {
__DEV__: true,
fail: true,
NodeJS: true,
HTMLDivElement: true,
HTMLElement: true,
HTMLInputElement: true,
HTMLSelectElement: true,
JSX: true,
},
env: {
browser: true,
commonjs: true,
es6: true,
'jest/globals': true,
node: true,
},
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
rules: {
'comma-dangle': ['error', 'always-multiline'],
indent: 'off',
'no-var': 'error',
'no-async-promise-executor': 'off',
'no-case-declarations': 'off',
'no-prototype-builtins': 'off',
'no-duplicate-imports': 'off',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'space-in-parens': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
camelcase: ['error', { allow: ['__export_format', '__export_date', '__export_source'] }],
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
'filenames/match-exported': [
'error',
'kebab',
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
'spaced-comment': ['error', 'always', {
exceptions: ['/', '*', '-', '* '], // for ASCII art :)
markers: [
'/', // for TypeScript directives, doxygen, vsdoc, etc. (which use `///`)
'?', // for Quokka
],
}],
'@typescript-eslint/array-type': ['error', { default: 'array', readonly: 'array' }],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
quotes: 'off',
'@typescript-eslint/quotes': ['error', 'single', { avoidEscape: true }],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'error',
},
};
52 changes: 0 additions & 52 deletions .eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
node-version: ${{ steps.nvm.outputs.NVMRC }}
- name: Bootstrap packages
run: npm run bootstrap
- name: Lint
run: npm run lint
- name: Run tests
run: npm test
- name: Build for smoke tests
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ graphql.config.json
.graphqlconfig
schema.graphql
packages/insomnia-smoke-test/screenshots
*.tsbuildinfo
dist
7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

20 changes: 20 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** @type { import('@jest/types').Config.InitialOptions } */
module.exports = {
globals: {
'ts-jest': {
isolatedModules: true,
},
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testEnvironment: 'node',
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testMatch: [
'**/*.test.ts',
],
verbose: false,
resetMocks: true,
resetModules: true,
collectCoverage: false,
};
Loading

0 comments on commit 5f4c19d

Please sign in to comment.