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

Removed tslint, added eslint #313

Merged
merged 5 commits into from
Apr 22, 2022
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
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ save: &save
key: code-{{ .Revision }}
paths:
- .
- "~/.npm-global"
- '~/.npm-global'

restore: &restore
restore_cache:
Expand All @@ -45,6 +45,7 @@ jobs:
- <<: *node-image
steps:
- <<: *restore
- run: cd example && npm i
- run: npm run lint
test:
docker:
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
env: {
browser: true,
es2021: true,
mocha: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:react/recommended',
'plugin:sonarjs/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'import', 'sonarjs'],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
},
}
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
}
}
]
}
}
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "17.0.2",
"react": "18.0.0",
"react-csv-downloader": "file:../",
"react-dom": "17.0.2",
"react-scripts": "5.0.0"
"react-dom": "18.0.0",
"react-scripts": "5.0.1"
},
"scripts": {
"start": "react-scripts start"
Expand Down
12 changes: 12 additions & 0 deletions example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const asyncComputeDatas = async () => {
return Promise.resolve(datas)
}

const asyncUndefined = async () => {
return Promise.resolve(undefined)
}

function App() {
return (
<div className="App">
Expand All @@ -44,6 +48,14 @@ function App() {
datas={asyncComputeDatas}
text="Using Async Callback to Compute Datas"
/>

<CsvDownloader
filename="myfile"
separator=";"
columns={head}
datas={asyncUndefined}
text="Async Callback returning undefined"
/>
</header>
</div>
)
Expand Down
6 changes: 3 additions & 3 deletions mocha.bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const config = require("./tsconfig.json");
const config = require('./tsconfig.json')

config.compilerOptions.module = "commonjs";
config.compilerOptions.module = 'commonjs'
config.transpileOnly = true

require("ts-node").register(config);
require('ts-node').register(config)
Loading