Skip to content

Commit

Permalink
Chore: Eslint & Prettier setup (#72)
Browse files Browse the repository at this point in the history
* Switch from npm to yarn v1

* Setup eslint & prettier

* Format & fix Linting
  • Loading branch information
ugur-eren authored May 22, 2024
1 parent 7d5bc6a commit af4ff42
Show file tree
Hide file tree
Showing 61 changed files with 9,916 additions and 16,767 deletions.
53 changes: 53 additions & 0 deletions JoyboyCommunity/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
require('@uniswap/eslint-config/load');

module.exports = {
extends: ['@uniswap/eslint-config/react'],

env: {
'react-native/react-native': true,
},

plugins: ['react', 'react-native', 'react-hooks'],

rules: {
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
'no-empty': 'warn',
'@typescript-eslint/no-empty-function': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/function-component-definition': [
'error',
{
unnamedComponents: ['function-expression', 'arrow-function'],
namedComponents: ['function-declaration', 'arrow-function'],
},
],
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
'react/jsx-filename-extension': [1, {extensions: ['.js', '.jsx', '.ts', '.tsx']}],
'react/prop-types': 'off',
'react/button-has-type': 'off',
'react-native/no-raw-text': 'off',
'react-native/no-single-element-style-arrays': 'error',
'react/jsx-one-expression-per-line': 'off',

// These configs should be enabled after the hackathon and we have time to fix all the issues
'react-native/no-unused-styles': 'off',
'react-native/no-inline-styles': 'off',
'react-native/no-color-literals': 'off',
},

overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'import/no-unused-modules': 'off',
},
},
],
};
5 changes: 5 additions & 0 deletions JoyboyCommunity/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text eol=lf

# Windows files should use crlf line endings other should use lf
# https://help.github.com/articles/dealing-with-line-endings/
*.bat text eol=crlf
8 changes: 8 additions & 0 deletions JoyboyCommunity/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"bracketSpacing": false,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"bracketSameLine": false,
"endOfLine": "lf"
}
Loading

0 comments on commit af4ff42

Please sign in to comment.