Skip to content

Commit 85f7b1e

Browse files
authored
Merge pull request #100 from UTDNebula/prettier-import-sort
Replaces ESLint import sorting with Pretttier import sorting
2 parents 2053a6c + a384363 commit 85f7b1e

17 files changed

+67
-203
lines changed

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,11 @@ module.exports = {
66
trailingComma: 'all',
77
useTabs: false,
88
endOfLine: 'auto',
9+
plugins: ['@ianvs/prettier-plugin-sort-imports'],
10+
importOrder: [
11+
'<BUILTIN_MODULES>', // Node.js built-in modules
12+
'<THIRD_PARTY_MODULES>', // Imports not matched by other special words or groups.
13+
'^(@src)(/.*)$',
14+
'^[.]', // relative imports
15+
],
916
};

package-lock.json

Lines changed: 40 additions & 164 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"dependencies": {
2020
"@emotion/react": "^11.14.0",
2121
"@emotion/styled": "^11.14.0",
22+
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
2223
"@mui/icons-material": "^5.17.1",
2324
"@mui/material": "^5.17.1",
2425
"@plasmohq/messaging": "^0.7.1",
@@ -46,7 +47,6 @@
4647
"eslint-plugin-jsx-a11y": "^6.10.2",
4748
"eslint-plugin-react": "^7.37.5",
4849
"eslint-plugin-react-hooks": "^5.2.0",
49-
"eslint-plugin-simple-import-sort": "^12.1.1",
5050
"postcss": "^8.5.3",
5151
"prettier": "^3.5.3",
5252
"tailwindcss": "^3.4.17",
@@ -65,7 +65,6 @@
6565
],
6666
"parser": "@typescript-eslint/parser",
6767
"plugins": [
68-
"simple-import-sort",
6968
"@typescript-eslint"
7069
],
7170
"rules": {
@@ -85,8 +84,6 @@
8584
]
8685
}
8786
],
88-
"simple-import-sort/imports": "error",
89-
"simple-import-sort/exports": "error",
9087
"import/first": "error",
9188
"import/newline-after-import": "error",
9289
"import/no-duplicates": "error",

src/app/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { sendToBackground } from '@plasmohq/messaging';
2-
import React, { useEffect, useState } from 'react';
3-
42
import type { ShowCourseTabPayload } from '~background';
53
import CourseOverview from '~components/CourseOverview';
64
import Landing from '~components/Landing';
@@ -17,10 +15,11 @@ import type { GenericFetchedData } from '~types/GenericFetchedData';
1715
import type { GradesData, GradesType } from '~types/GradesType';
1816
import {
1917
convertToProfOnly,
20-
type SearchQuery,
2118
searchQueryEqual,
2219
searchQueryLabel,
20+
type SearchQuery,
2321
} from '~types/SearchQuery';
22+
import React, { useEffect, useState } from 'react';
2423

2524
//Find GPA, total, and grade_distribution based on including some set of semesters
2625
function calculateGrades(grades: GradesData, academicSessions?: string[]) {

src/background/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Storage } from '@plasmohq/storage';
2-
32
import {
43
addGCalButtons,
54
listenForTableChange,

src/background/messages/getScrapeData.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { PlasmoMessaging } from '@plasmohq/messaging';
2-
32
import { getScrapedCourseData } from '..';
43

54
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {

src/components/BarGraph.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { useMediaQuery } from '@mui/material';
2+
import { useRainbowColors } from '~utils/colors';
23
import { type ApexOptions } from 'apexcharts';
34
import dynamic from 'next/dynamic';
45
import React from 'react';
56

6-
import { useRainbowColors } from '~utils/colors';
7-
87
const Chart = dynamic(() => import('react-apexcharts'), { ssr: false });
98

109
type GraphProps = {

src/components/CourseOverview.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Skeleton } from '@mui/material';
2-
import React from 'react';
3-
42
import { TRENDS_URL } from '~data/config';
53
import type { GenericFetchedData } from '~types/GenericFetchedData';
64
import type { GradesType } from '~types/GradesType';
7-
import { type SearchQuery, searchQueryLabel } from '~types/SearchQuery';
5+
import { searchQueryLabel, type SearchQuery } from '~types/SearchQuery';
86
import gpaToLetterGrade from '~utils/gpaToLetterGrade';
7+
import React from 'react';
98

109
type CourseOverviewProps = {
1110
header: string | SearchQuery;

0 commit comments

Comments
 (0)