diff --git a/eslint.config.mjs b/eslint.config.mjs index dd8ea00d..48df0808 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -7,6 +7,7 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import js from '@eslint/js'; import { FlatCompat } from '@eslint/eslintrc'; +import stylistic from '@stylistic/eslint-plugin'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); @@ -28,6 +29,7 @@ security.configs.recommended, security, pluginCypress, '@typescript-eslint': typescriptEslint, + '@stylistic': stylistic }, languageOptions: { @@ -45,7 +47,12 @@ security.configs.recommended, }, rules: { - indent: ['error', 4], + '@stylistic/indent': ['error', 4], + '@stylistic/max-len': [2, { + code: 80, + tabWidth: 4, + ignoreUrls: true, + }], 'linebreak-style': ['error', 'unix'], 'no-unused-vars': ['error', { @@ -55,13 +62,6 @@ security.configs.recommended, quotes: ['error', 'single'], semi: ['error', 'always'], - - 'max-len': [2, { - code: 80, - tabWidth: 4, - ignoreUrls: true, - }], - 'space-before-function-paren': ['error', 'never'], 'space-in-parens': ['error', 'never'], 'no-trailing-spaces': ['error'], diff --git a/package-lock.json b/package-lock.json index 4d678850..a41e9c3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ "@babel/preset-env": "^7.22.10", "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.21.5", + "@stylistic/eslint-plugin": "^5.3.1", "@testing-library/jest-dom": "^6.1.0", "@testing-library/react": "^16.0.0", "@types/jest": "^29.5.1", @@ -3663,6 +3664,63 @@ "@sinonjs/commons": "^3.0.0" } }, + "node_modules/@stylistic/eslint-plugin": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.3.1.tgz", + "integrity": "sha512-Ykums1VYonM0TgkD0VteVq9mrlO2FhF48MDJnPyv3MktIB2ydtuhlO0AfWm7xnW1kyf5bjOqA6xc7JjviuVTxg==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/types": "^8.41.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=9.0.0" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/@typescript-eslint/types": { + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.43.0.tgz", + "integrity": "sha512-vQ2FZaxJpydjSZJKiSW/LJsabFFvV7KgLC5DiLhkBcykhQj8iK9BOaDmQt74nnKdLvceM5xmhaTF+pLekrxEkw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@swc/helpers": { "version": "0.5.15", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", diff --git a/package.json b/package.json index 01add0ad..31a2e20c 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "@babel/preset-env": "^7.22.10", "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.21.5", + "@stylistic/eslint-plugin": "^5.3.1", "@testing-library/jest-dom": "^6.1.0", "@testing-library/react": "^16.0.0", "@types/jest": "^29.5.1", diff --git a/src/about.tsx b/src/about.tsx index cf21123f..06107077 100644 --- a/src/about.tsx +++ b/src/about.tsx @@ -1,3 +1,4 @@ + import React from 'react'; export const About: React.FC = () => { @@ -7,28 +8,30 @@ export const About: React.FC = () => {

About Statify

- Using Spotify data, this project redevelops a series of - interactive simulations to support inquiry-based - learning of basic statistical concepts in Frontiers - of Science seminar sessions. + Using Spotify data, this project redevelops a series of + interactive simulations to support inquiry-based + learning of basic statistical concepts in Frontiers + of Science seminar sessions.

Faculty Partners

- Center for Teaching and Learning at Columbia University + Center for Teaching and Learning at Columbia University

@@ -50,12 +53,12 @@ export const About: React.FC = () => {

Questions and Feedback

- If you’re interested in implementing this tool in your - teaching practice, to learn more about Statify, or to - send feedback on this application, please reach out to - the CTL project team. Email us at  + If you’re interested in implementing this tool in your + teaching practice, to learn more about Statify, or to + send feedback on this application, please reach out to + the CTL project team. Email us at  - ctl-statify@columbia.edu. + ctl-statify@columbia.edu.

diff --git a/src/assignments/answer.tsx b/src/assignments/answer.tsx index 19be8576..bd8da38a 100644 --- a/src/assignments/answer.tsx +++ b/src/assignments/answer.tsx @@ -38,7 +38,7 @@ export const Answer: React.FC = ( if(localAnswers[questionId]){ setAnswers(() => { - // eslint-disable-next-line max-len + /* eslint-disable-next-line @stylistic/max-len */ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment answers[questionId] = localAnswers[questionId]; return answers; diff --git a/src/assignments/assignment.tsx b/src/assignments/assignment.tsx index d3ac28eb..d9dfc2d3 100644 --- a/src/assignments/assignment.tsx +++ b/src/assignments/assignment.tsx @@ -132,7 +132,7 @@ export const Assignment: React.FC = (
{nameError && ( @@ -152,7 +152,7 @@ export const Assignment: React.FC = (
{uniError && ( @@ -182,8 +182,8 @@ export const Assignment: React.FC = (

:

Must have at least 1 screenshot - before the assignment can be - created. + before the assignment can be + created.

}
diff --git a/src/assignments/assignmentDocument.tsx b/src/assignments/assignmentDocument.tsx index 88f313b4..fb90de2a 100644 --- a/src/assignments/assignmentDocument.tsx +++ b/src/assignments/assignmentDocument.tsx @@ -95,7 +95,7 @@ export const AssignmentDocument: React.FC = ( return ( <> - Question {index + 1} + Question {index + 1} {question} @@ -142,7 +142,7 @@ export const AssignmentDocument: React.FC = ( {(screenshot.length > 0) && ( <> - Evidence (Screenshot) + Evidence (Screenshot) {screenshot.map((image, key) => = (
  • - Contact Us + Contact Us
  • diff --git a/src/graphs/estimatedSampleDistribution.tsx b/src/graphs/estimatedSampleDistribution.tsx index 0a1cd50b..94552e83 100644 --- a/src/graphs/estimatedSampleDistribution.tsx +++ b/src/graphs/estimatedSampleDistribution.tsx @@ -120,7 +120,7 @@ export const EstimatedDistribution: React.FC = ( const se2 = stdError(data2, n), mean2 = mean(data2) ?? 0; const gWidth = Number.parseInt(svgGraph.style('width')) - MARGIN; const height = - Number.parseInt(svgGraph.style('height')) - MARGIN * 2; + Number.parseInt(svgGraph.style('height')) - MARGIN * 2; // Data arrays must contain at least two datapoints const yScale = data1.length > 1 && data2.length > 1 ? Math.max( diff --git a/src/graphs/genrePicker.tsx b/src/graphs/genrePicker.tsx index 5d8f083f..dba1e5bc 100644 --- a/src/graphs/genrePicker.tsx +++ b/src/graphs/genrePicker.tsx @@ -102,13 +102,14 @@ export const GenrePicker: React.FC = ({ ); }; - /* eslint-disable max-len */ const displaySortDirection = function() { if (sortAsc) { return (<> A-Z + { } + {/* eslint-disable-next-line @stylistic/max-len */} ); @@ -117,12 +118,13 @@ export const GenrePicker: React.FC = ({ Z-A + {/* eslint-disable-next-line @stylistic/max-len */} ); } }; - /* eslint-enable max-len */ + useEffect(() => { if (sortedPopular) { diff --git a/src/graphs/graphForm.tsx b/src/graphs/graphForm.tsx index b2e8044b..36adb42e 100644 --- a/src/graphs/graphForm.tsx +++ b/src/graphs/graphForm.tsx @@ -264,7 +264,7 @@ export const GraphForm: React.FC = ({
    = ( const gWidth = Number.parseInt(svgGraph.style('width')) - MARGIN; const height = - Number.parseInt(svgGraph.style('height')) - MARGIN * 2; + Number.parseInt(svgGraph.style('height')) - MARGIN * 2; const activeArea = gWidth - MARGIN - Y_LABEL; const bucketPadding = activeArea < 480 ? 1 : 4; diff --git a/src/notFound.tsx b/src/notFound.tsx index 14a66fc9..c9145042 100644 --- a/src/notFound.tsx +++ b/src/notFound.tsx @@ -17,15 +17,15 @@ export const NotFound: React.FC = () => {

    Page not found

    - We're sorry. The page you're looking for - doesn't exist at this address. + We're sorry. The page you're looking for + doesn't exist at this address.