Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Split eslint and prettier #335

Merged
merged 12 commits into from
Dec 6, 2023
26 changes: 8 additions & 18 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Dependencies
/node_modules
/.pnp
.pnp.js

# Testing
/coverage
Expand All @@ -11,28 +9,20 @@
/dist
/out

# Min Files
/public/lib

# No linting needed
**/__tests__/
# Autogenerated files
/public/lib/*
**/participant_responses
**/firebase-service-account.json
psiturkit/*_turk

*.log
*.log*

# Misc
/.husky
/.vscode
/.env
.env
.DS_Store
/.pnp
.pnp.js
Comment on lines +24 to +25
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're using modern yarn?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, just npm. But it's been the gitignore since I started on the project 🤷‍♂️

.gitignore

# File types
# TODO: Only running on js and jsx anyways?
# *.md
# *.json
# *.loga
# *.log
# *.log*
.DS_Store
**/firebase-service-account.json
37 changes: 17 additions & 20 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
module.exports = {
root: true,
env: {
browser: true,
es6: true,
jest: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
// TODO 325: Add rules for import order
"prettier",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: "module",
ecmaVersion: 2023,
},
plugins: ["react"],
rules: {
"react/prop-types": "off", // TODO: These should be added so the rule can be removed
},
settings: {
react: {
version: "detect",
},
},
env: {
browser: true,
node: true,
es6: true,
},
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
plugins: ["react", "prettier"],
extends: ["eslint:recommended", "plugin:react/recommended", "prettier"],
rules: {
"react/prop-types": "off",
"prettier/prettier": "warn",
},
overrides: [{ files: ["*.jsx", "*.js"] }],
};
13 changes: 10 additions & 3 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
/**
* This file defines specific rules for Prettier. It adjusts their default settings.
* The CCV recommends these settings if your lab does not have specific style standards.
* We recommend these settings if your lab does not have specific style standards.
*/
module.exports = {
trailingComma: "es5", // Add a trailing comma to all es5 modules
printWidth: 100, // Sets the maximum line size to 100 (default is 80)
endOfLine: "auto", // Configure the end of line character (/n) | REQUIRED FOR OS COMPATIBILITY
quoteProps: "as-needed", // Add quotes around props as needed
trailingComma: "es5", // Add a trailing comma to all es5 modules
overrides: [
{
// Treats .firebaserc as a json file
files: ".firebaserc",
options: { parser: "json" },
},
],
};
Loading