Skip to content

Commit 34cff91

Browse files
committed
migrate eslint configs from json to flat
1 parent cb75a47 commit 34cff91

File tree

6 files changed

+1094
-604
lines changed

6 files changed

+1094
-604
lines changed

.eslintrc.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"prettier.prettierPath": "./node_modules/prettier/index.cjs",
23
"[javascript]": {
34
"editor.defaultFormatter": "esbenp.prettier-vscode"
45
},

eslint.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
5+
import nextPlugin from "@next/eslint-plugin-next";
6+
import * as mdx from "eslint-plugin-mdx";
7+
8+
export default [
9+
{ languageOptions: { globals: globals.browser } },
10+
pluginJs.configs.recommended,
11+
...tseslint.configs.recommended,
12+
{ plugins: { "@next/next": nextPlugin }},
13+
{ ...mdx.flat },
14+
eslintPluginPrettierRecommended,
15+
{
16+
ignores: [".next/*", "node_modules/*"],
17+
},
18+
];

package.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint",
9+
"lint": "npx eslint .",
1010
"export": "next export",
1111
"deploy": "gh-pages -d build"
1212
},
@@ -42,19 +42,29 @@
4242
"rehype-img-size": "^1.0.1",
4343
"rehype-slug": "^5.0.1",
4444
"swiper": "^11.1.0",
45-
"typescript": "^5.4.4",
45+
"typescript": "^5.4.5",
4646
"typewriter-effect": "^2.18.2",
4747
"wnumb": "^1.2.0"
4848
},
4949
"devDependencies": {
50-
"@typescript-eslint/parser": "^7.8.0",
51-
"eslint": "8.14.0",
50+
"@eslint/js": "^9.4.0",
51+
"@next/eslint-plugin-next": "^14.2.3",
52+
"@typescript-eslint/eslint-plugin": "^7.11.0",
53+
"@typescript-eslint/parser": "^7.11.0",
54+
"eslint": "8.x",
5255
"eslint-config-next": "12.1.5",
5356
"eslint-config-prettier": "^9.1.0",
54-
"eslint-plugin-mdx": "^2.0.2",
57+
"eslint-plugin-mdx": "^3.1.5",
5558
"eslint-plugin-prettier": "^5.1.3",
59+
"globals": "^15.3.0",
5660
"prettier": "^3.2.3",
57-
"sass": "^1.51.0"
61+
"sass": "^1.51.0",
62+
"typescript-eslint": "^7.11.0"
63+
},
64+
"resolutions": {
65+
"strip-ansi": "6.0.1",
66+
"string-width": "4.2.2",
67+
"wrap-ansi": "7.0.0"
5868
},
5969
"description": "This repository houses the source code for UNSW Co-op Society's website, hosted at [https://coopsoc.com.au](https://coopsoc.com.au) and written in [Next.js](https://nextjs.org). Visit our website and explore around!",
6070
"main": "next.config.js",

scripts/form-validation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
(function () {
1+
(() => {
22
"use strict";
33

44
// Fetch all the forms we want to apply custom Bootstrap validation styles to
55
var forms = document.querySelectorAll(".needs-validation");
66

77
// Loop over them and prevent submission
8-
Array.prototype.slice.call(forms).forEach(function (form: HTMLFormElement) {
8+
Array.prototype.slice.call(forms).forEach((form: HTMLFormElement) => {
99
form.addEventListener(
1010
"submit",
1111
function (event) {

0 commit comments

Comments
 (0)