-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update linters and clean out unnecessary config (#4)
- update linters - removed prettier (i prefer optimizing later.. so in this case not having excess files like the prettier files if they are not used)
- Loading branch information
1 parent
8c57f6e
commit cb1af1f
Showing
21 changed files
with
599 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
**/node_modules/* | ||
**/out/* | ||
**/.next/* | ||
webpack.* | ||
yarn.lock | ||
*.json | ||
*.md | ||
*.toml | ||
|
||
*.css | ||
*.scss | ||
*.js | ||
|
||
node_modules/ | ||
dist/ | ||
public/ | ||
.next/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2020: true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:import/typescript', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 11, | ||
sourceType: 'module', | ||
project: './tsconfig.json', | ||
}, | ||
plugins: [ | ||
'import', | ||
'react', | ||
'@typescript-eslint', | ||
], | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
} | ||
}, | ||
rules: { | ||
'linebreak-style': [ 'error', 'unix' ], | ||
|
||
'@typescript-eslint/no-require-imports': [ 'error' ], | ||
|
||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ argsIgnorePattern: '^_' } | ||
], | ||
|
||
// 2 space indentation | ||
'@typescript-eslint/indent': [ 'error', 2 ], | ||
|
||
// Style | ||
'quotes': [ 'error', 'single', { avoidEscape: true } ], | ||
|
||
// ensures clean diffs, see https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8 | ||
'comma-dangle': [ 'error', 'always-multiline' ], | ||
|
||
// Require all imported dependencies are actually declared in package.json | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
optionalDependencies: false, // Disallow importing optional dependencies (those shouldn't be in use in the project) | ||
peerDependencies: false, // Disallow importing peer dependencies (that aren't also direct dependencies) | ||
}, | ||
], | ||
|
||
// Require all imported libraries actually resolve (!!required for import/no-extraneous-dependencies to work!!) | ||
'import/no-unresolved': [ 'error' ], | ||
|
||
// Require an ordering on all imports | ||
'import/order': ['warn', { | ||
groups: ['builtin', 'external'], | ||
alphabetize: { order: 'asc', caseInsensitive: true }, | ||
}], | ||
|
||
// Cannot import from the same module twice | ||
'no-duplicate-imports': ['error'], | ||
|
||
// Cannot shadow names | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': ['error'], | ||
|
||
// Required spacing in property declarations (copied from TSLint, defaults are good) | ||
'key-spacing': ['error'], | ||
|
||
// Require semicolons | ||
'semi': ['error', 'always'], | ||
|
||
// Don't unnecessarily quote properties | ||
'quote-props': ['error', 'consistent-as-needed'], | ||
|
||
// No multiple empty lines | ||
'no-multiple-empty-lines': ['error'], | ||
|
||
// Max line lengths | ||
'max-len': ['error', { | ||
code: 120, | ||
ignoreUrls: true, // Most common reason to disable it | ||
ignoreStrings: true, // These are not fantastic but necessary for error messages | ||
ignoreTemplateLiterals: true, | ||
ignoreComments: true, | ||
ignoreRegExpLiterals: true, | ||
}], | ||
|
||
// One of the easiest mistakes to make | ||
'@typescript-eslint/no-floating-promises': ['error'], | ||
|
||
// Don't leave log statements littering the premises! | ||
'no-console': ['error'], | ||
|
||
// Useless diff results | ||
'no-trailing-spaces': ['error'], | ||
|
||
// Must use foo.bar instead of foo['bar'] if possible | ||
'dot-notation': ['error'], | ||
|
||
// Are you sure | is not a typo for || ? | ||
'no-bitwise': ['error'], | ||
|
||
// Member ordering | ||
'@typescript-eslint/member-ordering': ['error', { | ||
default: [ | ||
'public-static-field', | ||
'public-static-method', | ||
'protected-static-field', | ||
'protected-static-method', | ||
'private-static-field', | ||
'private-static-method', | ||
|
||
'field', | ||
|
||
// Constructors | ||
'constructor', // = ['public-constructor', 'protected-constructor', 'private-constructor'] | ||
|
||
// Methods | ||
'method', | ||
], | ||
}], | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ function Footer(): JSX.Element { | |
made by acm at ucla, with next | ||
</div> | ||
</footer> | ||
) | ||
); | ||
} | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ function Navbar(): JSX.Element { | |
</div> | ||
</div> | ||
</nav> | ||
) | ||
); | ||
} | ||
|
||
export default Navbar; |
Oops, something went wrong.