Skip to content

Commit

Permalink
STSMACOM-654 migrate to @babel/eslint-parser (#1210)
Browse files Browse the repository at this point in the history
Migrate from `babel-eslint` to `@babel/eslint-parser`. 

Refs STSMACOM-605
  • Loading branch information
zburke authored Apr 14, 2022
1 parent 54bfd56 commit cd38c4b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
27 changes: 11 additions & 16 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
{
"extends": "@folio/eslint-config-stripes",
"parser": "babel-eslint",
"plugins": ["react-hooks"],
"parser": "@babel/eslint-parser",
"rules": {
"max-len": ["warn", { "code": 120 }],
"operator-linebreak": ["off"],
"prefer-object-spread": "off",
"react/sort-prop-types": ["error"],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/prop-types": [
"error",
{
"skipUndeclared": true
}
]
"global-require": "off",
"import/no-cycle": [ 2, { "maxDepth": 1 } ],
"import/no-dynamic-require": "off",
"import/no-extraneous-dependencies": "off",
"prefer-object-spread": "off"
},
"overrides": [
{
"files": ["lib/**/tests/**"],
"files": [ "lib/**/tests/**", "tests/**" ],
"rules": {
"no-unused-expressions": "off",
"func-names": "off",
"no-unused-expressions": "off",
"max-len": "off",
"one-var": "off",
"max-classes-per-file": "off"
}
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const propTypes = {
helpText: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
selectField: PropTypes.shape({
defaults: PropTypes.array,
defaults: PropTypes.arrayOf(PropTypes.string),
options: PropTypes.shape({
sorted: PropTypes.arrayOf(PropTypes.string),
values: PropTypes.arrayOf(PropTypes.string),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default class MultiSelectionFilter extends React.Component {
static propTypes = {
dataOptions: PropTypes.arrayOf(PropTypes.shape({
label: PropTypes.node,
value: PropTypes.any,
value: PropTypes.node,
})).isRequired,
name: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
"formatjs-compile": "formatjs compile-folder --ast --format simple ./translations/stripes-smart-components ./translations/stripes-smart-components/compiled"
},
"devDependencies": {
"@babel/eslint-parser": "^7.17.0",
"@bigtest/convergence": "^1.0.0",
"@bigtest/interactor": "^0.7.2",
"@bigtest/mocha": "^0.5.1",
"@bigtest/react": "^0.1.2",
"@folio/eslint-config-stripes": "^5.2.0",
"@folio/eslint-config-stripes": "^6.1.0",
"@folio/stripes-cli": "^2.5.0",
"@folio/stripes-components": "^10.1.0",
"@folio/stripes-connect": "^7.0.0",
Expand All @@ -48,7 +49,6 @@
"@folio/stripes-util": "^5.1.0",
"@formatjs/cli": "^4.2.20",
"axe-core": "4.3.3",
"babel-eslint": "^10.1.0",
"chai": "^4.2.0",
"core-js": "^3.6.5",
"eslint": "^6.2.1",
Expand Down
6 changes: 6 additions & 0 deletions tests/connectStripes.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import { withStripes } from '@folio/stripes-core';

export default function connectStripes(component) {
class Connected extends Component {
static propTypes = {
stripes: PropTypes.object,
}

constructor(props) {
super(props);
this.connected = props.stripes.connect(component);
Expand Down

0 comments on commit cd38c4b

Please sign in to comment.