Skip to content

Commit

Permalink
Merge pull request #32 from HolecekM/lint-and-format
Browse files Browse the repository at this point in the history
Lint and format
  • Loading branch information
HappyStoic authored Nov 27, 2024
2 parents 4f360e8 + 697e580 commit ab5e0bc
Show file tree
Hide file tree
Showing 22 changed files with 2,119 additions and 65 deletions.
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ Please describe the tests that you ran to verify your changes. Provide instructi
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] (If modifying dashboard client) I have checked my code for lints with
`eslint` and formatted it properly using `prettier`
- [ ] (If modifying dashboard server) I have checked my code for lints with
`pylint` and formatted it properly using `autopep8`
1 change: 1 addition & 0 deletions dashboard/client/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
25 changes: 25 additions & 0 deletions dashboard/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# StratoCyberLab Dashboard - Client

## Development

- `npm ci` to install dependencies
- `npm run dev` to run the development server (with hot reload)
- `npm run build` to build (this is done when building the Docker image)

## Code Quality

Before committing your changes, please make sure they do not generate new
warnings (contain lints) and the code is properly formatted.

### Linting

We use [ESLint](https://eslint.org/) to check client code for lints.
You can either use IDE integration (make sure your IDE supports ESLint **9**) or
the command `npx eslint src` (in this directory) to run code analysis.

### Formatting

[Prettier](https://prettier.io/) is used for on-the-fly formatting.
We recommend enabling automatic formatting on save using your IDE.
You can also run the command `npx prettier -w src` (in this directory) to
reformat all code.
28 changes: 28 additions & 0 deletions dashboard/client/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import eslintPluginSvelte from 'eslint-plugin-svelte';
import js from '@eslint/js';
import globals from 'globals';

export default [
{
languageOptions: {
globals: {
...globals.browser,
},
},
},
js.configs.recommended,
{
rules: {
'no-throw-literal': 'error',
}
},
...eslintPluginSvelte.configs['flat/recommended'],
{
files: ['!src/**/*'],
languageOptions: {
globals: {
...globals.node,
},
},
}
];
Loading

0 comments on commit ab5e0bc

Please sign in to comment.