Skip to content

Commit

Permalink
#439 FIX: eslint error rules being ignored on build (#440)
Browse files Browse the repository at this point in the history
fixes #439 

- Errors now showing on build and will now exit the build process on any
eslint error
- All file changes had to do with config and/or fixing errors now that
they are showing up.

![CleanShot_2024-07-19_at_13 36
09](https://github.com/user-attachments/assets/8452c1d2-11aa-4ced-b355-39ff3e09ef61)

---------

Co-authored-by: Shashi Lo <[email protected]>
  • Loading branch information
chris-nowicki and shashilo authored Jul 19, 2024
1 parent 229f2db commit b7319b9
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/*.test.ts
**/*.test.tsx
**/*.test.js
**/*.test.jsx
**/*.test.jsx
next-env.d.ts
15 changes: 14 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@
"rules": {
"no-unused-vars": "off"
}
},
{
"files": ["playwright.config.ts"],
"rules": {
"no-undefined": "off"
}
},
{
"files": ["functions/userAuth.js"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-var-requires": "off"
}
}
]
}
}
3 changes: 3 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import '@testing-library/jest-dom';
10 changes: 9 additions & 1 deletion middleware.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import { NextResponse, type NextRequest } from 'next/server'

export async function middleware(request: NextRequest) {
/**
* Checks if the request is a POST request and if so, returns the response object
* @param request - The request object
* @returns {NextResponse} - The response object
*/
export async function middleware(request: NextRequest): Promise<NextResponse> {
try {
return NextResponse.next({
request: {
Expand Down
6 changes: 5 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ module.exports = {
images: {
domains: ['a.espncdn.com'],
},
}
eslint: {
ignoreDuringBuilds: false,
dirs: ["."],
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"storybook-docs": "storybook dev --docs",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"lint": "next lint --quiet"
"lint": "npx next lint --dir ."
},
"dependencies": {
"@hookform/resolvers": "^3.3.4",
Expand Down
8 changes: 7 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import { defineConfig, devices } from '@playwright/test';
import { execSync } from 'child_process';

// Get the current branch
/**
* Get the current branch
* @returns {void}
*/
function getCurrentBranch(): string {
try {
const branch = execSync('git rev-parse --abbrev-ref HEAD')
Expand Down
3 changes: 3 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

module.exports = {
plugins: {
tailwindcss: {},
Expand Down
5 changes: 4 additions & 1 deletion prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

module.exports = {
printWidth: 80,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
};
};
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"**/*.tsx",
".next/types/**/*.ts",
"jest.config.ts"
],
, "functions/userAuth.ts" ],
"exclude": ["node_modules"]
}
}

0 comments on commit b7319b9

Please sign in to comment.