Skip to content

Commit 1a18765

Browse files
authored
Merge pull request #58 from kolorfilm/chore/migrate-to-eslint-version-9
Migrate to ESLint version 9
2 parents 20a3167 + 930ad47 commit 1a18765

13 files changed

+458
-299
lines changed

.eslintrc.json

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

.github/dependabot.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ updates:
1616
dependency-type: 'production'
1717
development-dependencies:
1818
dependency-type: 'development'
19-
ignore:
20-
- dependency-name: 'eslint'
21-
versions: ['^9.x']
2219

2320
- package-ecosystem: github-actions
2421
directory: '/'

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [2.0.7] - 2024-10-24
8+
9+
### Changed
10+
11+
- migrate eslint to version 9
12+
713
## [2.0.6] - 2023-09-06
814

915
### Changed

eslint.config.mjs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import js from '@eslint/js'
2+
import eslint from '@eslint/js'
3+
import tseslint from 'typescript-eslint'
4+
import globals from 'globals'
5+
import nextPlugin from '@next/eslint-plugin-next'
6+
import reactPlugin from 'eslint-plugin-react'
7+
import reactHooksPlugin from 'eslint-plugin-react-hooks'
8+
import jestPlugin from 'eslint-plugin-jest'
9+
import eslintConfigPrettier from 'eslint-config-prettier'
10+
11+
export default tseslint.config(
12+
{
13+
extends: [
14+
js.configs.recommended,
15+
eslint.configs.recommended,
16+
...tseslint.configs.recommended,
17+
eslintConfigPrettier,
18+
],
19+
languageOptions: {
20+
globals: {
21+
...globals.es2020,
22+
...globals.node,
23+
...globals.browser,
24+
...globals.jest,
25+
},
26+
ecmaVersion: 'latest',
27+
sourceType: 'module',
28+
},
29+
plugins: {
30+
'@next/next': nextPlugin,
31+
react: reactPlugin,
32+
'react-hooks': reactHooksPlugin,
33+
jest: jestPlugin,
34+
},
35+
ignores: ['**/public/**', '**/.next/**'],
36+
settings: {
37+
react: {
38+
version: 'detect',
39+
},
40+
},
41+
linterOptions: {
42+
reportUnusedDisableDirectives: 'off',
43+
},
44+
rules: {
45+
...nextPlugin.configs.recommended.rules,
46+
...reactHooksPlugin.configs.recommended.rules,
47+
},
48+
},
49+
{
50+
files: ['server/**', 'setupTests.ts'],
51+
rules: {
52+
'@typescript-eslint/no-require-imports': 'off',
53+
},
54+
}
55+
)

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
collectCoverageFrom: [
77
'**/*.{js,jsx,ts,tsx}',
88
'!<rootDir>/next-env.d.ts',
9-
'!<rootDir>/next.config.js',
9+
'!<rootDir>/next.config.mjs',
1010
'!.next/**',
1111
'!**/node_modules/**',
1212
'!**/libs/**',

modules/OrdersHighcharts.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,12 @@ const initHighcharts = (containerId: string, orders: OrdersMapped): void => {
8787
const month = new Date(this.x as number).getMonth()
8888
let totalFees = 0
8989
let htmlItems = '<div>' + tooltipHeaderAsString()
90-
let i = 0
9190

9291
orders.seriesItems.forEach((item) => {
9392
const item_year = new Date(item.created).getFullYear()
9493
const item_month = new Date(item.created).getMonth()
9594

9695
if (item_year === year && item_month === month) {
97-
i++
9896
htmlItems += tooltipLineItemAsString(item)
9997
totalFees += item.fee
10098
}

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

next.config.js

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

next.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import path from 'path'
2+
import Dotenv from 'dotenv-webpack'
3+
import { config } from 'dotenv'
4+
5+
config()
6+
7+
const nextConfig = {
8+
reactStrictMode: true,
9+
trailingSlash: true,
10+
webpack: (config) => {
11+
config.plugins = [
12+
...config.plugins,
13+
14+
// Read the .env file
15+
new Dotenv({
16+
path: path.join(process.cwd(), '.env'),
17+
systemvars: true,
18+
}),
19+
]
20+
21+
return config
22+
},
23+
}
24+
25+
export default nextConfig

0 commit comments

Comments
 (0)