Skip to content

Commit fc6d34d

Browse files
committed
Fix eslint
1 parent 75e3f01 commit fc6d34d

File tree

13 files changed

+104
-40
lines changed

13 files changed

+104
-40
lines changed

eslint.config.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import path from 'node:path';
77
import { fileURLToPath } from 'node:url';
88
import js from '@eslint/js';
99
import { FlatCompat } from '@eslint/eslintrc';
10+
import stylistic from '@stylistic/eslint-plugin';
1011

1112
const __filename = fileURLToPath(import.meta.url);
1213
const __dirname = path.dirname(__filename);
@@ -28,6 +29,7 @@ security.configs.recommended,
2829
security,
2930
pluginCypress,
3031
'@typescript-eslint': typescriptEslint,
32+
'@stylistic': stylistic
3133
},
3234

3335
languageOptions: {
@@ -45,7 +47,12 @@ security.configs.recommended,
4547
},
4648

4749
rules: {
48-
indent: ['error', 4],
50+
'@stylistic/indent': ['error', 4],
51+
'@stylistic/max-len': [2, {
52+
code: 80,
53+
tabWidth: 4,
54+
ignoreUrls: true,
55+
}],
4956
'linebreak-style': ['error', 'unix'],
5057

5158
'no-unused-vars': ['error', {
@@ -55,13 +62,6 @@ security.configs.recommended,
5562

5663
quotes: ['error', 'single'],
5764
semi: ['error', 'always'],
58-
59-
'max-len': [2, {
60-
code: 80,
61-
tabWidth: 4,
62-
ignoreUrls: true,
63-
}],
64-
6565
'space-before-function-paren': ['error', 'never'],
6666
'space-in-parens': ['error', 'never'],
6767
'no-trailing-spaces': ['error'],

package-lock.json

Lines changed: 58 additions & 0 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"@babel/preset-env": "^7.22.10",
4848
"@babel/preset-react": "^7.18.6",
4949
"@babel/preset-typescript": "^7.21.5",
50+
"@stylistic/eslint-plugin": "^5.3.1",
5051
"@testing-library/jest-dom": "^6.1.0",
5152
"@testing-library/react": "^16.0.0",
5253
"@types/jest": "^29.5.1",

src/about.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
import React from 'react';
23

34
export const About: React.FC = () => {
@@ -7,28 +8,30 @@ export const About: React.FC = () => {
78
<div className='col-12 col-lg-7 px-2'>
89
<h1 className='mb-3'>About Statify</h1>
910
<p>
10-
Using Spotify data, this project redevelops a series of
11-
interactive simulations to support inquiry-based
12-
learning of basic statistical concepts in Frontiers
13-
of Science seminar sessions.
11+
Using Spotify data, this project redevelops a series of
12+
interactive simulations to support inquiry-based
13+
learning of basic statistical concepts in Frontiers
14+
of Science seminar sessions.
1415
</p>
1516

1617
<h2 className='mb-3'>Faculty Partners</h2>
1718

1819
<ul className='mb-5'>
1920
<li>
20-
Nicholas Bock, Department of Earth & Environmental Sciences
21+
Nicholas Bock, Department of Earth &amp;
22+
Environmental Sciences
2123
</li>
2224
<li>
23-
Vincent FitzPatrick, Department of Biological Sciences
25+
Vincent FitzPatrick, Department of Biological
26+
Sciences
2427
</li>
2528
<li>
26-
Debora Monego, Department of Chemistry
29+
Debora Monego, Department of Chemistry
2730
</li>
2831
</ul>
2932

3033
<h2 className='mb-3'>
31-
Center for Teaching and Learning at Columbia University
34+
Center for Teaching and Learning at Columbia University
3235
</h2>
3336

3437
<ul className='mb-5'>
@@ -41,7 +44,7 @@ export const About: React.FC = () => {
4144

4245
<h2 className='mb-3'>License</h2>
4346
<p className='mb-5'>Statify source code is available on <a href='https://github.com/ccnmtl/statify' target='_blank' rel='noopener noreferrer'>
44-
Github</a> under the<a href='https://www.gnu.org/licenses/gpl-3.0.en.html' target='_blank' rel='noopener noreferrer'> GNU GPLv3 license</a>.
47+
Github</a> under the<a href='https://www.gnu.org/licenses/gpl-3.0.en.html' target='_blank' rel='noopener noreferrer'> GNU GPLv3 license</a>.
4548
</p>
4649
</div>
4750
<div className='col-12 col-lg-4 offset-lg-1 px-2'>
@@ -50,12 +53,12 @@ export const About: React.FC = () => {
5053
<h2 className='h4 d-none d-lg-block'>
5154
Questions and Feedback</h2>
5255
<p>
53-
If you’re interested in implementing this tool in your
54-
teaching practice, to learn more about Statify, or to
55-
send feedback on this application, please reach out to
56-
the CTL project team. Email us at&nbsp;
56+
If you’re interested in implementing this tool in your
57+
teaching practice, to learn more about Statify, or to
58+
send feedback on this application, please reach out to
59+
the CTL project team. Email us at&nbsp;
5760
<a href='mailto:ctl-statify@columbia.edu'>
58-
ctl-statify@columbia.edu.</a>
61+
ctl-statify@columbia.edu.</a>
5962
</p>
6063
</div>
6164
</div>

src/assignments/answer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const Answer: React.FC<AnswerProps> = (
3838

3939
if(localAnswers[questionId]){
4040
setAnswers(() => {
41-
// eslint-disable-next-line max-len
41+
/* eslint-disable-next-line @stylistic/max-len */
4242
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
4343
answers[questionId] = localAnswers[questionId];
4444
return answers;

src/assignments/assignment.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const Assignment: React.FC<AssignmentProps> = (
132132
<div>
133133
<label htmlFor={'name-input'}
134134
className={'form-label'}>
135-
Name:
135+
Name:
136136
</label>
137137
{nameError && (
138138
<span className={'text-danger fs-6 ms-5'}>
@@ -152,7 +152,7 @@ export const Assignment: React.FC<AssignmentProps> = (
152152
<div>
153153
<label htmlFor={'uni-input'}
154154
className={'form-label'}>
155-
Uni:
155+
Uni:
156156
</label>
157157
{uniError && (
158158
<span className={'text-danger fs-6 ms-5'}>
@@ -182,8 +182,8 @@ export const Assignment: React.FC<AssignmentProps> = (
182182
</p> :
183183
<p className='text-warning'>
184184
Must have at least 1 screenshot
185-
before the assignment can be
186-
created.
185+
before the assignment can be
186+
created.
187187
</p>
188188
}
189189
<button
@@ -198,7 +198,7 @@ export const Assignment: React.FC<AssignmentProps> = (
198198
disabled={pdfButton}
199199
onClick={() => void generatePdfDocument()}
200200
className={'btn btn-primary btn-statify col-4'}>
201-
Create Assignment
201+
Create Assignment
202202
</button>
203203
</div>
204204
</div>

src/assignments/assignmentDocument.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const AssignmentDocument: React.FC<AssignmentDocumentProps> = (
9595
return (
9696
<>
9797
<Text style={styles.questionTitle}>
98-
Question {index + 1}
98+
Question {index + 1}
9999
</Text>
100100
<Text style={styles.question}>
101101
{question}
@@ -142,7 +142,7 @@ export const AssignmentDocument: React.FC<AssignmentDocumentProps> = (
142142
{(screenshot.length > 0) && (
143143
<>
144144
<Text style={styles.answerTitle} break>
145-
Evidence (Screenshot)
145+
Evidence (Screenshot)
146146
</Text>
147147
{screenshot.map((image, key) =>
148148
<Image

src/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const Footer: React.FC<PageSelect> = (
2727
<li className='nav-item'>
2828
<a href={'mailto:ctl-statify@columbia.edu'}
2929
className={'nav-link'}>
30-
Contact Us
30+
Contact Us
3131
</a>
3232
</li>
3333
</ul>

src/graphs/estimatedSampleDistribution.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const EstimatedDistribution: React.FC<EstimatedDistributionProps> = (
120120
const se2 = stdError(data2, n), mean2 = mean(data2) ?? 0;
121121
const gWidth = Number.parseInt(svgGraph.style('width')) - MARGIN;
122122
const height =
123-
Number.parseInt(svgGraph.style('height')) - MARGIN * 2;
123+
Number.parseInt(svgGraph.style('height')) - MARGIN * 2;
124124

125125
// Data arrays must contain at least two datapoints
126126
const yScale = data1.length > 1 && data2.length > 1 ? Math.max(

src/graphs/genrePicker.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,14 @@ export const GenrePicker: React.FC<GenreProps> = ({
102102
);
103103
};
104104

105-
/* eslint-disable max-len */
106105
const displaySortDirection = function() {
107106
if (sortAsc) {
108107
return (<>
109108
A-Z
110109
<span className='mx-2'></span>
110+
{ }
111111
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' className='bi bi-arrow-down-circle' viewBox='0 0 16 16'>
112+
{/* eslint-disable-next-line @stylistic/max-len */}
112113
<path fillRule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z'/>
113114
</svg>
114115
</>);
@@ -117,12 +118,13 @@ export const GenrePicker: React.FC<GenreProps> = ({
117118
Z-A
118119
<span className='mx-2'></span>
119120
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' className='bi bi-arrow-up-circle' viewBox='0 0 16 16'>
121+
{/* eslint-disable-next-line @stylistic/max-len */}
120122
<path fillRule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-7.5 3.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V11.5z'/>
121123
</svg>
122124
</>);
123125
}
124126
};
125-
/* eslint-enable max-len */
127+
126128

127129
useEffect(() => {
128130
if (sortedPopular) {

0 commit comments

Comments
 (0)