Skip to content

chore: Add ESLint and Prettier configuration files for code quality #26

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 15 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
ee7cc58
feat: Integrate Vitest for testing and coverage in the temporal worker
anatolyshipitz May 19, 2025
5ef9232
fix: Add missing newline at end of files in Vitest configuration and …
anatolyshipitz May 19, 2025
7bb5c80
chore: Update package-lock.json with resolved URLs and integrity hashes
anatolyshipitz May 19, 2025
075310a
chore: Update dependencies and enhance documentation in main worker
anatolyshipitz May 19, 2025
7c7d5c9
chore: Add ESLint and Prettier configuration files for code quality
anatolyshipitz May 19, 2025
37264a7
chore: Update configuration files for code quality improvements
anatolyshipitz May 19, 2025
96dd98c
chore: Update TypeScript version and improve test imports
anatolyshipitz May 19, 2025
17d29aa
chore: Refactor ESLint and Vitest configurations for improved clarity
anatolyshipitz May 19, 2025
709dca0
chore: Update code quality workflow to include ESLint and dependency …
anatolyshipitz May 19, 2025
2d571f8
Merge branch 'feature/64211-temporal-worker-tests' into feature/64211…
anatolyshipitz May 19, 2025
063b11a
chore: Fix ESLint configuration by removing trailing comma
anatolyshipitz May 19, 2025
a8c46d6
chore: Update Prettier configuration for improved formatting
anatolyshipitz May 21, 2025
1d2de23
Merge branch 'main' into feature/64211-temporal-worker-eslint
anatolyshipitz May 21, 2025
176975a
chore: Simplify ESLint configuration by removing unnecessary structure
anatolyshipitz May 21, 2025
03b0848
chore: Update ESLint configuration in package.json
anatolyshipitz May 21, 2025
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
10 changes: 8 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run linting
run: echo "Linting..."
- name: Install dependencies
run: cd workers/main && npm ci
- name: Run ESLint
run: cd workers/main && npm run eslint

sonarqube:
name: SonarQube
Expand All @@ -25,6 +27,10 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install dependencies
run: cd workers/main && npm ci
- name: Run tests with coverage
run: cd workers/main && npm run coverage
- name: Run SonarQube scan
uses: SonarSource/sonarqube-scan-action@v5
env:
Expand Down
2 changes: 2 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
sonar.projectKey=speedandfunction_automatization
sonar.organization=speedandfunction
sonar.javascript.lcov.reportPaths=workers/main/coverage/lcov.info
sonar.exclusions=**/src/__tests__/**,**/src/dist/**
4 changes: 4 additions & 0 deletions workers/main/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
/.nx/cache
11 changes: 11 additions & 0 deletions workers/main/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"trailingComma": "all",
"printWidth": 80,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"bracketSameLine": false,
"endOfLine": "auto",
"quoteProps": "consistent"
}
79 changes: 79 additions & 0 deletions workers/main/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';
import eslintImport from 'eslint-plugin-import';
import simpleImportSort from 'eslint-plugin-simple-import-sort';

export default [
{
settings: {
'import/resolver': {
typescript: {
"node": {
"extensions": [".ts"]
}
},
},
},
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
parser: tsparser,
parserOptions: {
project: './tsconfig.json',
},
},
plugins: {
'@typescript-eslint': tseslint,
'prettier': prettier,
'import': eslintImport,
'simple-import-sort': simpleImportSort,
},
ignores: [
'node_modules',
'dist',
'eslint.config.mjs',
'coverage',
'coverage/*',
'coverage/**/*'
],
rules: {
...tseslint.configs.recommended.rules,
...tseslint.configs['recommended-requiring-type-checking'].rules,
...prettier.configs.recommended.rules,

'prettier/prettier': 'error',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-console': 'warn',
'no-debugger': 'warn',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'import/no-unresolved': 'error',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'return' },
{
blankLine: 'always',
prev: ['const', 'let', 'var', 'import'],
next: '*',
},
{
blankLine: 'any',
prev: ['const', 'let', 'var', 'import'],
next: ['const', 'let', 'var', 'import'],
},
],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},
];
Loading