Skip to content

Commit

Permalink
refactor: upgrade eslint (#756)
Browse files Browse the repository at this point in the history
* refactor: upgrade eslint

* test: add tests to lint
  • Loading branch information
dangreen committed Oct 12, 2021
1 parent 1742abe commit be37878
Show file tree
Hide file tree
Showing 8 changed files with 438 additions and 409 deletions.
16 changes: 8 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"standard",
"standard-react",
"plugin:prettier/recommended",
"prettier/standard",
"prettier/react",
"plugin:@typescript-eslint/eslint-recommended"
],
"env": {
"node": true
"browser": true
},
"parserOptions": {
"ecmaVersion": 2020,
"ecmaVersion": "latest",
"ecmaFeatures": {
"legacyDecorators": true,
"jsx": true
}
},
"settings": {
"react": {
"version": "16"
"version": "detect"
}
},
"rules": {
"curly": [2, "multi-line"],
"quotes": [2, "single", "avoid-escape"],
"react/display-name": 0,
"react/jsx-boolean-value": 1,
"jsx-quotes": 1,
"jsx-quotes": [1, "prefer-single"],
"react/jsx-no-undef": 1,
"react/jsx-sort-props": 0,
"react/jsx-uses-react": 1,
Expand All @@ -40,6 +38,8 @@
"react/react-in-jsx-scope": 1,
"react/self-closing-comp": 1,
"semi": [2, "always"],
"strict": 0
"strict": 0,
"no-use-before-define": 0,
"@typescript-eslint/no-use-before-define": 2
}
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"semi": true,
"tabWidth": 2,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"trailingComma": "es5"
}
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"prepublishOnly": "yarn build",
"test": "yarn test:unit && yarn test:lint && yarn test:build",
"test:build": "yarn build",
"test:lint": "eslint src/**/*.{ts,tsx}",
"test:lint": "eslint 'src/**/*.{ts,tsx}' 'test/**/*.{ts,tsx}'",
"test:unit": "jest -c jest.config.json",
"format": "prettier --write src",
"predeploy": "cd example && yarn && yarn build",
Expand All @@ -51,28 +51,28 @@
"@types/jest": "^27.0.2",
"@types/lodash": "^4.14.150",
"@types/react": "^17.0.28",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"babel-eslint": "^10.0.3",
"chart.js": "^3.1.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.7.0",
"eslint-config-standard": "^14.1.0",
"eslint-config-standard-react": "^9.2.0",
"eslint-plugin-import": "^2.18.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-config-standard-react": "^11.0.1",
"eslint-plugin-import": "^2.25.1",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-standard": "^5.0.0",
"gh-pages": "^3.2.3",
"jest": "^27.2.5",
"jest-canvas-mock": "^2.2.0",
"microbundle-crl": "^0.13.11",
"prettier": "^2.0.4",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-test-renderer": "^17.0.1"
"react-test-renderer": "^17.0.1",
"typescript": "^4.4.3"
},
"files": [
"dist"
Expand Down
2 changes: 0 additions & 2 deletions src/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import React, {
useMemo,
forwardRef,
} from 'react';
// eslint-disable-next-line no-unused-vars
import { Props } from './types';

import Chart from 'chart.js/auto';
// eslint-disable-next-line no-unused-vars
import type { ChartData } from 'chart.js';

import merge from 'lodash/merge';
Expand Down
1 change: 0 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { forwardRef } from 'react';
// eslint-disable-next-line no-unused-vars
import { Props } from './types';
import ChartComponent from './chart';
import Chart from 'chart.js/auto';
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line no-unused-vars
import Chart from './index';

export interface Props extends React.CanvasHTMLAttributes<HTMLCanvasElement> {
Expand Down
Loading

0 comments on commit be37878

Please sign in to comment.