This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add eslint as linter and prettier as formater for app
- Loading branch information
1 parent
02ee7dc
commit d1c720c
Showing
37 changed files
with
1,349 additions
and
122 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,9 @@ | ||
/public/build/** | ||
scripts/** | ||
.eslintrc.js | ||
jest.config.js | ||
cypress | ||
cypress.config.ts | ||
pkg/api/static/** | ||
**/dist | ||
dist/ |
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,55 @@ | ||
module.exports = { | ||
extends: [ | ||
'@grafana/eslint-config', | ||
'plugin:import/recommended', | ||
'plugin:import/typescript', | ||
], | ||
plugins: ['unused-imports'], | ||
rules: { | ||
'react-hooks/exhaustive-deps': 'warn', | ||
'no-duplicate-imports': 'off', | ||
'@typescript-eslint/no-duplicate-imports': 'error', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'unused-imports/no-unused-imports': 'error', | ||
'unused-imports/no-unused-vars': [ | ||
'warn', | ||
{ | ||
vars: 'all', | ||
varsIgnorePattern: '^_', | ||
args: 'after-used', | ||
argsIgnorePattern: '^_', | ||
}, | ||
], | ||
'import/no-relative-packages': 'error', | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
patterns: [ | ||
{ | ||
group: ['../*', './*'], | ||
message: | ||
'Usage of relative parent imports is not allowed. Please use absolute(use alias) imports instead.', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
env: { | ||
browser: true, | ||
jquery: true, | ||
}, | ||
settings: { | ||
'import/internal-regex': '^@webapp', | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.ts', '.tsx', '.es6', '.js', '.json', '.svg'], | ||
}, | ||
typescript: { | ||
project: 'tsconfig.json', | ||
}, | ||
}, | ||
}, | ||
parserOptions: { | ||
project: ['tsconfig.json'], | ||
}, | ||
}; |
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,14 @@ | ||
/public/build/** | ||
pkg/api/static/** | ||
**/dist | ||
dist/ | ||
*.md | ||
*.yaml | ||
*.yml | ||
*.html | ||
vendor/** | ||
tools/** | ||
operations/** | ||
api/** | ||
data/** | ||
**/testdata |
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 @@ | ||
{ "singleQuote": true } |
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 |
---|---|---|
@@ -1,2 +1,7 @@ | ||
["memory:alloc_objects:count::","memory:alloc_space:bytes::","memory:inuse_objects:count::","memory:inuse_space:bytes::","process_cpu:cpu:nanoseconds:cpu:nanoseconds"] | ||
|
||
[ | ||
"memory:alloc_objects:count::", | ||
"memory:alloc_space:bytes::", | ||
"memory:inuse_objects:count::", | ||
"memory:inuse_space:bytes::", | ||
"process_cpu:cpu:nanoseconds:cpu:nanoseconds" | ||
] |
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 |
---|---|---|
|
@@ -36,4 +36,3 @@ | |
// } | ||
// } | ||
import '@testing-library/cypress/add-commands'; | ||
|
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 |
---|---|---|
|
@@ -6,4 +6,3 @@ | |
}, | ||
"include": ["**/*.ts"] | ||
} | ||
|
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { loadAppNames } from '../hooks/loadAppNames'; | ||
import React from 'react'; | ||
import { useAppNames } from '@webapp/hooks/useAppNames'; | ||
|
||
// LoadAppNames loads all app names automatically | ||
export function LoadAppNames(props: { children?: React.ReactNode }) { | ||
loadAppNames(); | ||
useAppNames(); | ||
|
||
return <>{props.children}</>; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import React from 'react'; | ||
|
||
export function Label() { | ||
return <>Profile Type: </>; | ||
} | ||
|
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
Oops, something went wrong.