Skip to content

Commit

Permalink
ESLint + Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ra1nbow1 committed Jun 23, 2024
1 parent 6270584 commit 98ffe6c
Show file tree
Hide file tree
Showing 22 changed files with 7,982 additions and 7,130 deletions.
14 changes: 7 additions & 7 deletions .eslintrc.cts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
env: { browser: true, es2020: true, "jest": true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended'
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
parserOptions: { ecmaVersion: 'latest', sourceType: 'script' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
plugins: ['react', 'react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true } ],
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-var-requires': 'warning',
},
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.md
21 changes: 21 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "always",
"bracketSameLine": true,
"bracketSpacing": true,
"semi": false,
"experimentalTernaries": false,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"singleAttributePerLine": false,
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": false,
"proseWrap": "preserve",
"insertPragma": false,
"requirePragma": false,
"tabWidth": 4,
"embeddedLanguageFormatting": "auto",
"useTabs": true
}
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ Each database element looks like this:

```json
{
"pid": "string",
"title": "string",
"instructions": "string",
"difficulty": "<easy|normal|hard>",
"test_cases": [
"solution(args1) == result1",
"solution(args2) == result2",
],
"code": "string"
"pid": "string",
"title": "string",
"instructions": "string",
"difficulty": "<easy|normal|hard>",
"test_cases": ["solution(args1) == result1", "solution(args2) == result2"],
"code": "string"
}
```
13 changes: 13 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js'

export default [
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } }, globals: globals.browser } },
{ ignores: ['./server/api/index.ts'] },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReactConfig,
]
Loading

0 comments on commit 98ffe6c

Please sign in to comment.