Skip to content

Commit

Permalink
Add: 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
poboisvert committed Jul 16, 2024
1 parent ed66283 commit 32f70ec
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 39 deletions.
17 changes: 12 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
build/
dist/
node_modules/
.snapshots/
*.min.js
node_modules
**/node_modules/*
**/out/*
**/.next/*

.next/
.next
next-env.d.ts
node_modules
yarn.lock
package-lock.json
public
33 changes: 0 additions & 33 deletions .eslintrc

This file was deleted.

46 changes: 46 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 12,
sourceType: 'module'
},
settings: {
react: {
version: 'detect'
}
},
env: {
browser: true,
es2021: true,
amd: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:react/recommended',
'prettier',
'next/core-web-vitals'
],
plugins: ['react', '@typescript-eslint', 'simple-import-sort'],
rules: {
'class-methods-use-this': 'off',
'import/no-extraneous-dependencies': 0,
'import/no-named-as-default-member': 0,
'import/prefer-default-export': 0,
'@typescript-eslint/no-misused-promises': 0,
'@typescript-eslint/no-floating-promises': 0,
'@typescript-eslint/restrict-template-expressions': 0,
'@next/next/no-html-link-for-pages': 0,
'@typescript-eslint/strict-boolean-expressions': 0,
'@typescript-eslint/restrict-plus-operands': 0,
'@typescript-eslint/no-confusing-void-expression': 0,
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-unsafe-argument': 0
},
ignorePatterns: ['.next/*'] // <<< ignore all files in test folder
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-chartist",
"version": "1.1.2",
"version": "1.1.3",
"description": "2024+ Next.JS React.JS Create responsive, scalable and good looking charts with chartist.js",
"author": "poboisvert",
"license": "MIT",
Expand Down
9 changes: 9 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
singleQuote: true,
arrowParens: 'always',
trailingComma: 'none',
jsxBracketSameLine: true,
printWidth: 100,
tabWidth: 2,
semi: false
}
14 changes: 14 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,18 @@ NextChartist.propTypes = {
listener: PropTypes.object
}

// Remove defaultProps and update propTypes for 'type'
NextChartist.propTypes = {
...NextChartist.propTypes,
type: (props, propName, componentName) => {
const validTypes = ['LineChart', 'BarChart', 'PieChart']
if (!validTypes.includes(props[propName])) {
return new Error(
`Invalid prop '${propName}' supplied to '${componentName}'. ` +
`Expected one of ${validTypes.join(', ')}.`
)
}
}
}

export default NextChartist

0 comments on commit 32f70ec

Please sign in to comment.