Skip to content

Commit

Permalink
ci: update linter for each package
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgevrgs committed May 15, 2024
1 parent aada496 commit 7236739
Show file tree
Hide file tree
Showing 12 changed files with 460 additions and 6 deletions.
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";


export default [
{files: ["**/*.js"], languageOptions: {sourceType: "script"}},
{languageOptions: { globals: globals.node }},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
4 changes: 2 additions & 2 deletions libs/backend/application/clients/mongo.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { GridFSBucket, MongoClient } from 'mongodb';
import { IMAGES_COLLECTION } from '../../domain';

let client: MongoClient;
let collection: Record<string, any> = {};
let bucket: Record<string, GridFSBucket> = {};
const collection: Record<string, unknown> = {};
const bucket: Record<string, GridFSBucket> = {};

const mongoDbUrl = process.env.NEXT_MONGO_URL;

Expand Down
11 changes: 11 additions & 0 deletions libs/backend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";


export default [
{files: ["**/*.js"], languageOptions: {sourceType: "script"}},
{languageOptions: { globals: globals.node }},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
7 changes: 7 additions & 0 deletions libs/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "",
"scripts": {
"lint": "eslint .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
Expand All @@ -16,5 +17,11 @@
"peerDependencies": {
"lodash.omit": "4.5.0",
"mongodb": "4.9.1"
},
"devDependencies": {
"@eslint/js": "^9.2.0",
"eslint": "8.57.0",
"globals": "^15.2.0",
"typescript-eslint": "^7.9.0"
}
}
12 changes: 12 additions & 0 deletions libs/backend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"strict": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"jsx": "preserve",
"module": "ESNext",
"moduleResolution": "Node"
},
"include": ["./**/*.ts"],
"exclude": ["node_modules"]
}
27 changes: 27 additions & 0 deletions libs/frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import pluginJs from '@eslint/js';
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default [
{ files: ['**/*.js'], languageOptions: { sourceType: 'script' } },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReactConfig,
{
rules: {
'react/react-in-jsx-scope': 'off',
'react/no-unknown-property': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],
},
settings: {
react: {
version: 'detect',
},
},
},
];
4 changes: 3 additions & 1 deletion libs/frontend/infrastructure/pages/IndexPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ interface IndexPageProps extends BaseProps {
deviceType: LayoutContextType['deviceType'];
}

export const IndexPage: NextPage<IndexPageProps> = ({ deviceType }) => {
export const IndexPage: NextPage<IndexPageProps> = ({
deviceType,
}: IndexPageProps) => {
const { data, isLoading } = useGetCelebritiesQuery();

if (isLoading) {
Expand Down
6 changes: 6 additions & 0 deletions libs/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "",
"scripts": {
"lint": "eslint .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
Expand All @@ -24,8 +25,13 @@
"react-use": "17.4.0"
},
"devDependencies": {
"@eslint/js": "^9.2.0",
"@testing-library/react": "13.4.0",
"eslint": "8.57.0",
"eslint-plugin-react": "^7.34.1",
"globals": "^15.2.0",
"react-test-renderer": "18.2.0",
"typescript-eslint": "^7.9.0",
"vitest": "1.6.0"
}
}
11 changes: 11 additions & 0 deletions libs/shared/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";


export default [
{files: ["**/*.js"], languageOptions: {sourceType: "script"}},
{languageOptions: { globals: {...globals.browser, ...globals.node} }},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
7 changes: 7 additions & 0 deletions libs/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"peerDependencies": {
"pino": "8.5.0"
},
"devDependencies": {
"@eslint/js": "^9.2.0",
"eslint": "8.57.0",
"globals": "^15.2.0",
"typescript-eslint": "^7.9.0"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"private": true,
"scripts": {
"dev": "pnpm -r --filter='./apps/*' run dev",
"lint": "pnpm -r --filter='./apps/*' --filter=''./libs/* run lint",
"test": "vitest",
"test:e2e": "playwright test",
"serve": "sh ./.bin/01-serve.sh",
Expand All @@ -19,7 +20,7 @@
"@testing-library/react": "13.4.0",
"@types/node": "18.7.16",
"autoprefixer": "10.4.9",
"eslint": "8.23.1",
"eslint": "8.57.0",
"typescript": "5.4.5",
"vitest": "1.6.0"
}
Expand Down
Loading

0 comments on commit 7236739

Please sign in to comment.