Skip to content

Commit ba5a371

Browse files
authored
Migrate eslint config to support v9 and update Next dependency (CodeForPhilly#1165)
Migrate eslint config to new flat file structure for v9 and update ignores to several generated areas including the .next server and more as well as update next to 14.2.26 to avoid middleware vulnerability
1 parent 50f87d0 commit ba5a371

File tree

6 files changed

+173
-126
lines changed

6 files changed

+173
-126
lines changed

.eslintrc.json

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

CHANGELOG.md

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,45 @@
22

33
### Bug Fixes
44

5-
* **572:** fix webpack warnings + fix linting issues ([#574](https://github.com/jinks145/clean-and-green-philly/issues/574)) ([fbfd459](https://github.com/jinks145/clean-and-green-philly/commit/fbfd459ba147e51a2fd54bee61d5ca63fb74eb98))
6-
* Add focus styling to header links ([a99065c](https://github.com/jinks145/clean-and-green-philly/commit/a99065cba1607b981702e7aa7e654f24c108ad6e))
7-
* Add href to dropdown items to increase link size ([2eb4667](https://github.com/jinks145/clean-and-green-philly/commit/2eb4667e7b68f45489c51ea10aa7d15afd2a3c77))
8-
* closing tooltip popup on map closes property details ([432e8c0](https://github.com/jinks145/clean-and-green-philly/commit/432e8c0a14e1e9cfa199b030019c0730a24741c6))
9-
* correct the scrolling on the map page ([a850237](https://github.com/jinks145/clean-and-green-philly/commit/a8502372e243057e2b06559cb042d94ea894415a))
10-
* Remove nested link and button ([d93e8bd](https://github.com/jinks145/clean-and-green-philly/commit/d93e8bd52d80cd8d5b1a30910aaa4b168a11b57a))
11-
* Update footer markup structure for accessibility ([d5c2a33](https://github.com/jinks145/clean-and-green-philly/commit/d5c2a334f0e5c297f117dca5dc2972b56d7b3542))
12-
5+
- **572:** fix webpack warnings + fix linting issues ([#574](https://github.com/jinks145/clean-and-green-philly/issues/574)) ([fbfd459](https://github.com/jinks145/clean-and-green-philly/commit/fbfd459ba147e51a2fd54bee61d5ca63fb74eb98))
6+
- Add focus styling to header links ([a99065c](https://github.com/jinks145/clean-and-green-philly/commit/a99065cba1607b981702e7aa7e654f24c108ad6e))
7+
- Add href to dropdown items to increase link size ([2eb4667](https://github.com/jinks145/clean-and-green-philly/commit/2eb4667e7b68f45489c51ea10aa7d15afd2a3c77))
8+
- closing tooltip popup on map closes property details ([432e8c0](https://github.com/jinks145/clean-and-green-philly/commit/432e8c0a14e1e9cfa199b030019c0730a24741c6))
9+
- correct the scrolling on the map page ([a850237](https://github.com/jinks145/clean-and-green-philly/commit/a8502372e243057e2b06559cb042d94ea894415a))
10+
- Remove nested link and button ([d93e8bd](https://github.com/jinks145/clean-and-green-philly/commit/d93e8bd52d80cd8d5b1a30910aaa4b168a11b57a))
11+
- Update footer markup structure for accessibility ([d5c2a33](https://github.com/jinks145/clean-and-green-philly/commit/d5c2a334f0e5c297f117dca5dc2972b56d7b3542))
1312

1413
### Features
1514

16-
* **247:** make the mapbox legend more legible ([bcf6915](https://github.com/jinks145/clean-and-green-philly/commit/bcf691566fc26e834547a43efd863de58abdf3d4))
17-
* **293:** sort features by priority of high, medium, low ([8cd1058](https://github.com/jinks145/clean-and-green-philly/commit/8cd105872feb0065aa3d207d42dc5df76ef63dbc))
18-
* **305:** expand the header width of single property table ([b25261e](https://github.com/jinks145/clean-and-green-philly/commit/b25261e5d9e26bdbd9694aa03b4964771528dd3b))
19-
* **395:** add white background to backbutton bar ([a65f052](https://github.com/jinks145/clean-and-green-philly/commit/a65f052ca2e5c0eac2737f85b4997af6e993f750))
20-
* **395:** make property selection back button sticky ([6601201](https://github.com/jinks145/clean-and-green-philly/commit/6601201fcf943f8e64a1341327095e9b7edc6b08))
21-
* **457:** add filter count to button ([b35145a](https://github.com/jinks145/clean-and-green-philly/commit/b35145a1df5f2995294f829e0b7cde20ba0e0f29))
22-
* **535:** add close download view button ([#579](https://github.com/jinks145/clean-and-green-philly/issues/579)) ([9bd2c53](https://github.com/jinks145/clean-and-green-philly/commit/9bd2c53aa3b49da8136fa6e7e850c4dc4d5e2d74))
23-
* **544:** adjust remove property section ([#580](https://github.com/jinks145/clean-and-green-philly/issues/580)) ([900af8e](https://github.com/jinks145/clean-and-green-philly/commit/900af8e6fbfc89bd4ed83b17c9eed0a1d5a3de3b))
24-
* **568:** restyle the property table ([#577](https://github.com/jinks145/clean-and-green-philly/issues/577)) ([2c8cc92](https://github.com/jinks145/clean-and-green-philly/commit/2c8cc92b7f28aecdbe65412476691baa50254292))
25-
* Add arrow icon to link ([6bce3fa](https://github.com/jinks145/clean-and-green-philly/commit/6bce3fa84ad9827f2117a2d51ed2f2665e83481b))
26-
* Add content to sidebar ([23d5c52](https://github.com/jinks145/clean-and-green-philly/commit/23d5c52c3fcd1eb1eff902e7d1fd37ab2fe41b6d))
27-
* Add council district ([e576218](https://github.com/jinks145/clean-and-green-philly/commit/e5762185840f0bbc2289fede8481f5b39a16087d))
28-
* Add extra data to single detail page ([48e34fe](https://github.com/jinks145/clean-and-green-philly/commit/48e34fe0a6317fc8fc0f1f5e745dd165000d437f))
29-
* Add font ([c1a8b93](https://github.com/jinks145/clean-and-green-philly/commit/c1a8b93561dfc67c8eed31b3c8befa2b8ae984ec))
30-
* Add font to map ([1491518](https://github.com/jinks145/clean-and-green-philly/commit/14915180857a482a25d96f9f45f7c838082e2d71))
31-
* Add font to search field ([3b08069](https://github.com/jinks145/clean-and-green-philly/commit/3b080690ba92007545467bc2ce4bf3bcad26c899))
32-
* Add info cards ([8170944](https://github.com/jinks145/clean-and-green-philly/commit/8170944fdb8d8be36af062012967323047bda748))
33-
* Add missing data and atlas link; style table ([8c260d4](https://github.com/jinks145/clean-and-green-philly/commit/8c260d48e015ed6c8c29cc10b8936753cc013ff0))
34-
* Add percentage, update column widths ([41caf77](https://github.com/jinks145/clean-and-green-philly/commit/41caf77c55eb0a6336abc80047ed83584d250a64))
35-
* Add priority color square ([ad5a9fa](https://github.com/jinks145/clean-and-green-philly/commit/ad5a9faff3b9596256e680b3d6d95c54caefc7a7))
36-
* add redirect from map to find-properties ([439ed6c](https://github.com/jinks145/clean-and-green-philly/commit/439ed6c7291251aed9751431cd5bdc2fa6883a15))
37-
* Add row scope ([f945979](https://github.com/jinks145/clean-and-green-philly/commit/f945979edaee2ad5a003a5b5560a89cc25717f3b))
38-
* Add spacing below Back button ([7de48c5](https://github.com/jinks145/clean-and-green-philly/commit/7de48c50f177c0275cebac0a4a7d9dfce8d2cd2c))
39-
* Address a few more links ([b3b6733](https://github.com/jinks145/clean-and-green-philly/commit/b3b673375f1472f15d80bffeff378c973d6cb49d))
40-
* Adjust table per requirements ([36e6cfa](https://github.com/jinks145/clean-and-green-philly/commit/36e6cfa5934defadcf1a8b8ad1c09ffe609d0ec5))
41-
* Change Find Properties and Learn More to links ([1de0b47](https://github.com/jinks145/clean-and-green-philly/commit/1de0b474811ab2d4281d94c6a9d5882a8ebb0c13))
42-
* Close sidebar if clicking on empty map ([612117d](https://github.com/jinks145/clean-and-green-philly/commit/612117d6c54bc62baaae4f773013e196232c2dba))
43-
* Navigate to map on click; show popups ([183b6a2](https://github.com/jinks145/clean-and-green-philly/commit/183b6a224d651726a6e465d7c9549ef437626f9e))
44-
* Open sidebar from map ([5474367](https://github.com/jinks145/clean-and-green-philly/commit/54743673e99ffd6b939009ad54e4d0a4252ba044))
45-
* Pass selected property to map view ([663f142](https://github.com/jinks145/clean-and-green-philly/commit/663f14236ccb9246efa8882c0dfa44e8cbcba0f7))
46-
* underline links ([5f23d09](https://github.com/jinks145/clean-and-green-philly/commit/5f23d09da9a7258b284ccfef54b1be0ee2a8e1f8))
47-
* Update aria label and role ([765e5a4](https://github.com/jinks145/clean-and-green-philly/commit/765e5a4fef1941e93815ae4789093e047183101c))
15+
- **247:** make the mapbox legend more legible ([bcf6915](https://github.com/jinks145/clean-and-green-philly/commit/bcf691566fc26e834547a43efd863de58abdf3d4))
16+
- **293:** sort features by priority of high, medium, low ([8cd1058](https://github.com/jinks145/clean-and-green-philly/commit/8cd105872feb0065aa3d207d42dc5df76ef63dbc))
17+
- **305:** expand the header width of single property table ([b25261e](https://github.com/jinks145/clean-and-green-philly/commit/b25261e5d9e26bdbd9694aa03b4964771528dd3b))
18+
- **395:** add white background to backbutton bar ([a65f052](https://github.com/jinks145/clean-and-green-philly/commit/a65f052ca2e5c0eac2737f85b4997af6e993f750))
19+
- **395:** make property selection back button sticky ([6601201](https://github.com/jinks145/clean-and-green-philly/commit/6601201fcf943f8e64a1341327095e9b7edc6b08))
20+
- **457:** add filter count to button ([b35145a](https://github.com/jinks145/clean-and-green-philly/commit/b35145a1df5f2995294f829e0b7cde20ba0e0f29))
21+
- **535:** add close download view button ([#579](https://github.com/jinks145/clean-and-green-philly/issues/579)) ([9bd2c53](https://github.com/jinks145/clean-and-green-philly/commit/9bd2c53aa3b49da8136fa6e7e850c4dc4d5e2d74))
22+
- **544:** adjust remove property section ([#580](https://github.com/jinks145/clean-and-green-philly/issues/580)) ([900af8e](https://github.com/jinks145/clean-and-green-philly/commit/900af8e6fbfc89bd4ed83b17c9eed0a1d5a3de3b))
23+
- **568:** restyle the property table ([#577](https://github.com/jinks145/clean-and-green-philly/issues/577)) ([2c8cc92](https://github.com/jinks145/clean-and-green-philly/commit/2c8cc92b7f28aecdbe65412476691baa50254292))
24+
- Add arrow icon to link ([6bce3fa](https://github.com/jinks145/clean-and-green-philly/commit/6bce3fa84ad9827f2117a2d51ed2f2665e83481b))
25+
- Add content to sidebar ([23d5c52](https://github.com/jinks145/clean-and-green-philly/commit/23d5c52c3fcd1eb1eff902e7d1fd37ab2fe41b6d))
26+
- Add council district ([e576218](https://github.com/jinks145/clean-and-green-philly/commit/e5762185840f0bbc2289fede8481f5b39a16087d))
27+
- Add extra data to single detail page ([48e34fe](https://github.com/jinks145/clean-and-green-philly/commit/48e34fe0a6317fc8fc0f1f5e745dd165000d437f))
28+
- Add font ([c1a8b93](https://github.com/jinks145/clean-and-green-philly/commit/c1a8b93561dfc67c8eed31b3c8befa2b8ae984ec))
29+
- Add font to map ([1491518](https://github.com/jinks145/clean-and-green-philly/commit/14915180857a482a25d96f9f45f7c838082e2d71))
30+
- Add font to search field ([3b08069](https://github.com/jinks145/clean-and-green-philly/commit/3b080690ba92007545467bc2ce4bf3bcad26c899))
31+
- Add info cards ([8170944](https://github.com/jinks145/clean-and-green-philly/commit/8170944fdb8d8be36af062012967323047bda748))
32+
- Add missing data and atlas link; style table ([8c260d4](https://github.com/jinks145/clean-and-green-philly/commit/8c260d48e015ed6c8c29cc10b8936753cc013ff0))
33+
- Add percentage, update column widths ([41caf77](https://github.com/jinks145/clean-and-green-philly/commit/41caf77c55eb0a6336abc80047ed83584d250a64))
34+
- Add priority color square ([ad5a9fa](https://github.com/jinks145/clean-and-green-philly/commit/ad5a9faff3b9596256e680b3d6d95c54caefc7a7))
35+
- add redirect from map to find-properties ([439ed6c](https://github.com/jinks145/clean-and-green-philly/commit/439ed6c7291251aed9751431cd5bdc2fa6883a15))
36+
- Add row scope ([f945979](https://github.com/jinks145/clean-and-green-philly/commit/f945979edaee2ad5a003a5b5560a89cc25717f3b))
37+
- Add spacing below Back button ([7de48c5](https://github.com/jinks145/clean-and-green-philly/commit/7de48c50f177c0275cebac0a4a7d9dfce8d2cd2c))
38+
- Address a few more links ([b3b6733](https://github.com/jinks145/clean-and-green-philly/commit/b3b673375f1472f15d80bffeff378c973d6cb49d))
39+
- Adjust table per requirements ([36e6cfa](https://github.com/jinks145/clean-and-green-philly/commit/36e6cfa5934defadcf1a8b8ad1c09ffe609d0ec5))
40+
- Change Find Properties and Learn More to links ([1de0b47](https://github.com/jinks145/clean-and-green-philly/commit/1de0b474811ab2d4281d94c6a9d5882a8ebb0c13))
41+
- Close sidebar if clicking on empty map ([612117d](https://github.com/jinks145/clean-and-green-philly/commit/612117d6c54bc62baaae4f773013e196232c2dba))
42+
- Navigate to map on click; show popups ([183b6a2](https://github.com/jinks145/clean-and-green-philly/commit/183b6a224d651726a6e465d7c9549ef437626f9e))
43+
- Open sidebar from map ([5474367](https://github.com/jinks145/clean-and-green-philly/commit/54743673e99ffd6b939009ad54e4d0a4252ba044))
44+
- Pass selected property to map view ([663f142](https://github.com/jinks145/clean-and-green-philly/commit/663f14236ccb9246efa8882c0dfa44e8cbcba0f7))
45+
- underline links ([5f23d09](https://github.com/jinks145/clean-and-green-philly/commit/5f23d09da9a7258b284ccfef54b1be0ee2a8e1f8))
46+
- Update aria label and role ([765e5a4](https://github.com/jinks145/clean-and-green-philly/commit/765e5a4fef1941e93815ae4789093e047183101c))

eslint.config.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import { defineConfig, globalIgnores } from 'eslint/config';
2+
import react from 'eslint-plugin-react';
3+
import customRules from 'eslint-plugin-custom-rules';
4+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
5+
import prettier from 'eslint-plugin-prettier';
6+
import tsParser from '@typescript-eslint/parser';
7+
import path from 'node:path';
8+
import { fileURLToPath } from 'node:url';
9+
import js from '@eslint/js';
10+
import { FlatCompat } from '@eslint/eslintrc';
11+
12+
const __filename = fileURLToPath(import.meta.url);
13+
const __dirname = path.dirname(__filename);
14+
const compat = new FlatCompat({
15+
baseDirectory: __dirname,
16+
recommendedConfig: js.configs.recommended,
17+
allConfig: js.configs.all,
18+
});
19+
20+
export default defineConfig([
21+
globalIgnores([
22+
'**/next.config.js',
23+
'**/postcss.config.js',
24+
'.next/*',
25+
'eslint-plugin-custom-rules/*',
26+
]),
27+
{
28+
extends: compat.extends(
29+
'next/core-web-vitals',
30+
'plugin:react/recommended',
31+
'plugin:@typescript-eslint/recommended',
32+
'prettier'
33+
),
34+
35+
plugins: {
36+
react,
37+
'custom-rules': customRules,
38+
'@typescript-eslint': typescriptEslint,
39+
prettier,
40+
},
41+
42+
languageOptions: {
43+
parser: tsParser,
44+
ecmaVersion: 2020,
45+
sourceType: 'module',
46+
47+
parserOptions: {
48+
project: './tsconfig.json',
49+
},
50+
},
51+
52+
settings: {
53+
react: {
54+
version: 'detect',
55+
},
56+
},
57+
58+
rules: {
59+
'react/react-in-jsx-scope': 'off',
60+
'react/prop-types': 'off',
61+
'@typescript-eslint/no-explicit-any': 'warn',
62+
'@typescript-eslint/no-unused-vars': 'warn',
63+
'custom-rules/no-text-size-class': 'warn',
64+
'prettier/prettier': 'error',
65+
},
66+
},
67+
]);

0 commit comments

Comments
 (0)