Skip to content

Commit

Permalink
chore: run prettier and lint on frontend (#828)
Browse files Browse the repository at this point in the history
no functional changes. created scripts for prettier and lint in
package.json. reinstalled modules/lock and ran prettier on all files.
  • Loading branch information
Kevin101Zhang authored Jun 24, 2024
1 parent 5185457 commit 056f272
Show file tree
Hide file tree
Showing 67 changed files with 3,650 additions and 1,972 deletions.
50 changes: 12 additions & 38 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,17 @@
module.exports = {
parser: '@typescript-eslint/parser',
env: {
es2021: true,
jest: true
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@next/next/recommended',
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended',
],
overrides: [
{
files: ['./src/**/*.js', './src/**/*.jsx'],
parser: 'espree',
rules: {
semi: ['error', 'always'],
'comma-dangle': ['error', 'only-multiline'],
'eol-last': ['error', 'always'],
'@typescript-eslint/no-empty-function': ['warn', { allow: ['methods'] }],
},
},
{
files: ['./src/**/*', './tests/**/*', './**/*.json'],
excludedFiles: ['./src/**/*.js', './src/**/*.jsx'],
parserOptions: {
project: './tsconfig.json',
},
extends: ['standard-with-typescript'],
rules: {
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/comma-dangle': ['error', 'only-multiline'],
'@typescript-eslint/strict-boolean-expressions': 'off',
'eol-last': ['error', 'always'],
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-empty-function': ['warn', { allow: ['methods'] }],
},
},
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals", // extended set of recommended rules from Next.js
"prettier",
],
plugins: ["simple-import-sort", "@typescript-eslint"],
root: true,
rules: {
"simple-import-sort/imports": "warn",
"@typescript-eslint/no-explicit-any": "off", // TODO: remove once refactor from JS is complete
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unused-vars": ['warn', { argsIgnorePattern: "^_", "varsIgnorePattern": "^_" }],
'@typescript-eslint/no-empty-function': ['warn', { allow: ['methods'] }],
}
};
3 changes: 2 additions & 1 deletion frontend/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ module.exports = {
semi: true, // Add semicolons at the end of statements
singleQuote: true, // Use single quotes instead of double quotes
tabWidth: 2, // Set the tab width to 2 spaces
printWidth: 100, // Wrap lines that exceed 100 characters
singleAttributePerLine: false,
printWidth: 120, // Wrap lines that exceed 120 characters
trailingComma: 'all', // Use trailing commas wherever possible (multi-line objects and arrays)
arrowParens: 'always', // Always include parentheses around arrow function parameters
endOfLine: 'lf', // Use LF (line feed) as the line ending
Expand Down
Loading

0 comments on commit 056f272

Please sign in to comment.