Skip to content

Commit

Permalink
HEAT-230 hooking up prettier, eslint and typechecking (#5)
Browse files Browse the repository at this point in the history
Also starting to support multiple environments
  • Loading branch information
andrewrlee authored Mar 28, 2024
1 parent 2a88ea6 commit fceb264
Show file tree
Hide file tree
Showing 24 changed files with 4,557 additions and 1,007 deletions.
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DEV_APPINSIGHTS_ID=some-app-id
DEV_APPINSIGHTS_KEY=some-app-key

PREPROD_APPINSIGHTS_ID=some-app-id
PREPROD_APPINSIGHTS_KEY=some-app-key

PROD_APPINSIGHTS_ID=some-app-id
PROD_APPINSIGHTS_KEY=some-app-key
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
public
assets
cypress.json
reporter-config.json
dist/
104 changes: 104 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"env": {
"browser": true,
"node": true,
"jest": true
},

"plugins": ["import", "no-only-tests"],

"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true
},
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"]
}
}
},

"overrides": [
{
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"files": ["**/*.ts"],
"excludedFiles": "*.js",
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/no-use-before-define": 0,
"class-methods-use-this": 0,
"no-useless-constructor": 0,
"@typescript-eslint/no-unused-vars": [
1,
{
"argsIgnorePattern": "res|next|^err|_",
"ignoreRestSiblings": true
}
],
"@typescript-eslint/semi": 0,
"import/no-unresolved": "error",
"prettier/prettier": [
"error",
{
"trailingComma": "all",
"singleQuote": true,
"printWidth": 150,
"semi": false
}
]
}
}
],

"extends": ["airbnb-base", "plugin:prettier/recommended"],

"rules": {
"no-unused-vars": [
1,
{
"argsIgnorePattern": "res|next|^err|_",
"ignoreRestSiblings": true
}
],
"no-use-before-define": 0,
"semi": 0,
"import/no-unresolved": "error",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"mjs": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"comma-dangle": ["error", "always-multiline"],
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": ["**/*.test.js", "**/*.test.ts", "**/testutils/**", "cypress.config.ts"] }
],
"no-only-tests/no-only-tests": "error",
"prettier/prettier": [
"error",
{
"trailingComma": "all",
"singleQuote": true,
"printWidth": 150,
"semi": false
}
],
"no-empty-function": ["error", { "allow": ["constructors", "arrowFunctions"] }]
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules/
dependencies.csv
components.json
.env
dist
.eslintcache
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
15 changes: 15 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"trailingComma": "all",
"singleQuote": true,
"printWidth": 150,
"semi": false,
"arrowParens": "avoid",
"overrides": [
{
"files": "*.njk",
"options": {
"parser": "jinja-template"
}
}
]
}
10 changes: 5 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
export default {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['<rootDir>/src*/*.test.ts'],
testPathIgnorePatterns: ['/node_modules/', 'templates'],
};
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['<rootDir>/src*/*.test.ts'],
testPathIgnorePatterns: ['/node_modules/', 'templates'],
}
Loading

0 comments on commit fceb264

Please sign in to comment.