Skip to content

Commit

Permalink
style: configure eslint and prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
devshred committed May 17, 2024
1 parent 0324e03 commit 50b823a
Show file tree
Hide file tree
Showing 54 changed files with 630 additions and 561 deletions.
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
dist/
prettierrc.cjs
.eslintrc.js
vite.config.ts
env.d.ts

31 changes: 19 additions & 12 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:jsx-a11y/recommended',
'plugin:@typescript-eslint/recommended',
'eslint-config-prettier',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
'import/no-unresolved': ['error', { ignore: ['^geojson'] }],
},
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
prettierrc.cjs
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"printWidth": 100,
"bracketSpacing": true
}
Loading

0 comments on commit 50b823a

Please sign in to comment.