Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypeScript] Phase 1 #3267

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
93 changes: 93 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
module.exports = /** @type { import('eslint').Linter.Config } */ {
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,
},
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
],
}],
},
};
52 changes: 0 additions & 52 deletions .eslintrc.json

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
node-version: ${{ steps.nvm.outputs.NVMRC }}
- name: Bootstrap packages
run: npm run bootstrap
- name: Lint
run: npm run lint
- name: Typecheck # TODO(TSCONVERSION) remove when flow goes away since bootstrap does the TypeScript build which in turn will error if there are type errors
dimitropoulos marked this conversation as resolved.
Show resolved Hide resolved
run: npm run typecheck
- 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.

22 changes: 22 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

// @ts-check
module.exports = /** @type { import('@jest/types').Config.InitialOptions } */ {
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