Skip to content

Commit

Permalink
simplifies eslint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgnlez committed Apr 17, 2024
1 parent 62b8099 commit 5ed626d
Show file tree
Hide file tree
Showing 12 changed files with 356 additions and 521 deletions.
22 changes: 22 additions & 0 deletions client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** @type import('eslint').Linter.Config */
module.exports = {
extends: [
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: ['prettier'],
rules: {
'@typescript-eslint/no-unused-vars': ['warn'],
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'parent', 'sibling', 'index', 'internal', 'object', 'type'],
'newlines-between': 'always',
},
],
'no-console': ['warn'],
'no-debugger': ['warn'],
},
ignorePatterns: ['*.md'],
};
60 changes: 0 additions & 60 deletions client/.eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ COPY --chown=$USER:$USER public ./public

# NextJS required files
COPY --chown=$USER:$USER next.config.js local.d.ts \
postcss.config.js tailwind.config.ts entrypoint.sh \
tsconfig.json tsconfig.eslint.json .browserlistrc .eslintrc.js .prettierrc.cjs ./
postcss.config.cjs tailwind.config.ts entrypoint.sh \
tsconfig.json .browserlistrc .eslintrc.cjs .prettierrc.cjs ./

RUN yarn build

Expand Down
2 changes: 1 addition & 1 deletion client/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ const nextConfig = {
},
};

module.exports = nextConfig;
export default nextConfig;
14 changes: 6 additions & 8 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "landgriffon-client",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down Expand Up @@ -108,15 +109,12 @@
"@types/react": "18.2.28",
"@types/react-dom": "18.2.13",
"@types/uuid": "^9.0.5",
"@typescript-eslint/eslint-plugin": "6.8.0",
"@typescript-eslint/parser": "6.8.0",
"@typescript-eslint/eslint-plugin": "7.7.0",
"cypress": "13.2.0",
"eslint": "8.23.1",
"eslint-config-next": "13.5.5",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^5.1.2",
"eslint": "8.57.0",
"eslint-config-next": "14.2.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"istanbul-reports": "3.0.0",
"nyc": "15.1.0",
"nyc-report-lcov-absolute": "1.0.0",
Expand Down
File renamed without changes.
8 changes: 2 additions & 6 deletions client/src/components/map/layer-manager/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ export const MapboxOverlayProvider = ({ children }: PropsWithChildren) => {

const addLayer = useCallback(
(layer) => {
// TODO: fix this
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error to fix
const layers = OVERLAY._props.layers || [];

const l1 = new layer.type({
Expand All @@ -54,9 +52,7 @@ export const MapboxOverlayProvider = ({ children }: PropsWithChildren) => {

const removeLayer = useCallback(
(id) => {
// TODO: fix this, same as above
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error to fix
const layers = OVERLAY._props.layers || [];

OVERLAY.setProps({
Expand Down
1 change: 0 additions & 1 deletion client/src/components/table/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ declare module '@tanstack/table-core' {
theme: TableProps<TData>['theme'];
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface ColumnMeta<TData extends RowData, TValue> {
isSticky?: boolean | 'left' | 'right';
align?: 'left' | 'right' | 'center';
Expand Down
3 changes: 1 addition & 2 deletions client/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import type { ParsedUrlQuery } from 'querystring';

import 'styles/globals.css';

// eslint-disable-next-line @typescript-eslint/ban-types
export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
export type NextPageWithLayout<P = object, IP = P> = NextPage<P, IP> & {
Layout?: (page: ReactElement) => ReactNode;
};

Expand Down
5 changes: 0 additions & 5 deletions client/tsconfig.eslint.json

This file was deleted.

26 changes: 7 additions & 19 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,27 @@
{
"compilerOptions": {
"baseUrl": "./src",
"target": "ES2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"paths": {
"@/*": [
"./*"
],
"react": [ "./node_modules/@types/react" ]
},
"plugins": [
{
"name": "next"
}
]
],
"paths": {
"@/*": ["./*"]
}
},
"include": [
"next-env.d.ts",
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.d.ts",
"e2e/**/*.ts",
".next/types/**/*.ts"
],
"exclude": ["node_modules", ".next", "cypress"]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules", "cypress"]
}
Loading

0 comments on commit 5ed626d

Please sign in to comment.