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

feat(other): lint prettier #25

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module.exports = {
env: {
browser: true,
es2021: true
es2021: true,
},
extends: [
'standard',
Expand All @@ -13,12 +13,12 @@ module.exports = {
// 'plugin:import/typescript',
// 'plugin:promise/recommended',
// 'plugin:security/recommended-legacy',
'plugin:react/recommended'
'plugin:react/recommended',
],
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
sourceType: 'module'
sourceType: 'module',
},
plugins: [
// '@typescript-eslint',
Expand All @@ -27,21 +27,21 @@ module.exports = {
// 'security',
// 'no-catch-all',
'react',
'react-hooks'
'react-hooks',
],
settings: {
// 'import/resolver': {
// typescript: true,
// node: true,
// },
react: {
version: 'detect'
}
version: 'detect',
},
},
rules: {
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
'react/react-in-jsx-scope': 'off' // Disable requirement for React import
'react/react-in-jsx-scope': 'off', // Disable requirement for React import
// 'no-catch-all/no-catch-all': 'error',
// 'no-console': 'error',
// 'no-debugger': 'error',
Expand Down Expand Up @@ -139,7 +139,7 @@ module.exports = {
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser'
parser: '@typescript-eslint/parser',
// parserOptions: {
// tsconfigRootDir: __dirname,
// project: ['./tsconfig.json', '**/tsconfig.json'],
Expand All @@ -158,19 +158,19 @@ module.exports = {
// '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
// 'no-void': ['error', { allowAsStatement: true }],
// },
// },
// {
// files: ['!*.json'],
// plugins: ['prettier'],
// extends: ['plugin:prettier/recommended'],
// rules: {
// 'prettier/prettier': 'error',
// },
},
{
files: ['!*.json'],
plugins: ['prettier'],
extends: ['plugin:prettier/recommended'],
rules: {
'prettier/prettier': 'error',
},
},
{
files: ['*.json'],
plugins: ['json'],
extends: ['plugin:json/recommended-with-comments']
extends: ['plugin:json/recommended-with-comments'],
},
// {
// files: ['*.{test,spec}.[tj]s'],
Expand Down Expand Up @@ -206,7 +206,7 @@ module.exports = {
files: ['*.yaml', '*.yml'],
parser: 'yaml-eslint-parser',
plugins: ['yml'],
extends: ['plugin:yml/prettier']
}
]
extends: ['plugin:yml/prettier'],
},
],
}
14 changes: 14 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"endOfLine": "auto"
}
122 changes: 118 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@
"autoprefixer": "^10.4.14",
"daisyui": "^4.6.1",
"eslint": "^8.24.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-yml": "^1.14.0",
"postcss": "^8.4.21",
"prettier": "^3.3.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^2.75.7",
Expand Down
4 changes: 2 additions & 2 deletions postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
autoprefixer: {},
},
}
26 changes: 21 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@ export default {
format: 'esm',
exports: 'named',
sourcemap: true,
strict: false
}
strict: false,
},
],
plugins: [
postcss({
plugins: []
plugins: [],
}),
typescript()
typescript(),
],
external: [
'react',
'react-dom',
'leaflet',
'react-leaflet',
'react-toastify',
'react-string-replace',
'react-toastify/dist/ReactToastify.css',
'tw-elements',
'react-router-dom',
'react-leaflet-cluster',
'@tanstack/react-query',
'tributejs',
'prop-types',
'leaflet/dist/leaflet.css',
'@heroicons/react/20/solid',
],
external: ['react', 'react-dom', 'leaflet', 'react-leaflet', 'react-toastify', 'react-string-replace', 'react-toastify/dist/ReactToastify.css', 'tw-elements', 'react-router-dom', 'react-leaflet-cluster', '@tanstack/react-query', 'tributejs', 'prop-types', 'leaflet/dist/leaflet.css', '@heroicons/react/20/solid']
}
30 changes: 20 additions & 10 deletions src/Components/AppShell/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@ import { SetAssetsApi } from './SetAssetsApi'
import { AssetsApi } from '../../types'
import { ContextWrapper } from './ContextWrapper'

export function AppShell ({ appName, children, assetsApi, userType }: { appName: string, children: React.ReactNode, assetsApi: AssetsApi, userType: string }) {
export function AppShell({
appName,
children,
assetsApi,
userType,
}: {
appName: string
children: React.ReactNode
assetsApi: AssetsApi
userType: string
}) {
return (
<ContextWrapper>
<div className='tw-flex tw-flex-col tw-h-full'>
<SetAssetsApi assetsApi={assetsApi} />
<NavBar userType={userType} appName={appName}></NavBar>
<div id="app-content" className="tw-flex-grow">
{children}
</div>
</div>
</ContextWrapper>
<ContextWrapper>
<div className='tw-flex tw-flex-col tw-h-full'>
<SetAssetsApi assetsApi={assetsApi} />
<NavBar userType={userType} appName={appName}></NavBar>
<div id='app-content' className='tw-flex-grow'>
{children}
</div>
</div>
</ContextWrapper>
)
}
Loading