Skip to content

Setup #3

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

Merged
merged 23 commits into from
Jun 8, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
setup react liniting & tsconfig
  • Loading branch information
ShMcK committed Jun 4, 2019
commit 81a1041db9940a9aa5f548123d916f841a724591
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"vscode:prepublish": "npm run build",
"machine": "node ./out/state/index.js",
"build": "npm run compile && npm run build:web",
"build:web": "tsc -p web-app/ && cp -R web-app/build/ out/",
"build:web": "tsc -p web-app/tsconfig.json && cp -R web-app/build/ out/",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
Expand Down
61 changes: 61 additions & 0 deletions web-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
module.exports = {
parser: 'typescript-eslint-parser',
// extends: [
// 'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
// 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
// 'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
// 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
// ],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
useJSXTextNode: true,
},
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g.
'arrow-parens': 0,
'comma-dangle': 0,
'global-require': 0,
'import/no-extraneous-dependencies': 0,
'import/no-named-as-default': 0,
'import/prefer-default-export': 0,
'jsx-a11y/href-no-hash': 0,
quotes: ['error', 'single'],
'no-tabs': 0,
'react/jsx-curly-spacing': 0,
'react/jsx-indent-props': 'off',
'react/prop-types': 0,
'react/sort-comp': 0,
'react/prefer-stateless-function': 0,
semi: ['error', 'never'],
'object-curly-newline': 0,
'react/jsx-indent': 'off',
'class-methods-use-this': 0,
indent: 'off',
'implicit-arrow-linebreak': 'off',
'function-paren-newline': 'off',
'lines-between-class-members': 'off',
'no-unreachable': 'off',
'import/no-unresolved': 'off',
'no-unused-vars': 'off',
'no-confusing-arrow': 'off',
'no-restricted-syntax': 'off',
'react/jsx-one-expression-per-line': 'off',
'guard-for-in': 'off',
'no-nested-ternary': 'off',
'no-underscore-dangle': 'off',
'react/destructuring-assignment': 'off',
'no-return-assign': 'off',
'no-case-declarations': 'off',
'react/no-array-index-key': 'off',
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
}
35 changes: 35 additions & 0 deletions web-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build": "react-scripts build && cp -R ./build/ ../out/",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand All @@ -32,5 +32,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"typescript-eslint-parser": "^22.0.0"
}
}
26 changes: 24 additions & 2 deletions web-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
{
"extends": "./tsconfig.prod.json"
}
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve"
},
"include": [
"src"
]
}