Skip to content

Commit

Permalink
Adding jsconfig to enhance imports
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Nov 14, 2023
1 parent 6675de3 commit c26141f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
15 changes: 15 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"baseUrl": ".",
"checkJs": true,
"jsx": "react-jsx",
"paths": {
"src/*": [
"./src/*"
],
"components/*": [
"./src/components/*"
]
}
}
}
3 changes: 1 addition & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { Dropdown } from 'primereact/dropdown'
import { InputNumber } from 'primereact/inputnumber'
import { InputSwitch } from 'primereact/inputswitch'
import { InputText } from 'primereact/inputtext'
import { CustomInput } from './components/CustomInput'
import { useState } from 'react'

import { CustomInput } from './CustomInput'

const tiposDeAve = [
{ nombre: 'Golondrina Tijerita' },
{ nombre: 'Petrel' },
Expand Down
8 changes: 0 additions & 8 deletions src/CustomInput.jsx

This file was deleted.

14 changes: 14 additions & 0 deletions src/components/CustomInput.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import PropTypes from 'prop-types'

export const CustomInput = ({ enabled, children, value }) => {
if (!enabled) {
return <span className="disabled">{value ?? children.props.value}</span>
}
return children
}

CustomInput.propTypes = {
enabled: PropTypes.bool,
children: PropTypes.element,
value: PropTypes.any,
}
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default defineConfig({
setupFiles: ["./setupTests.js"],
environment: 'jsdom',
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'json-summary'],
},
}
Expand Down

0 comments on commit c26141f

Please sign in to comment.