Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #88 from rpearce/chore/react-18-and-build
Browse files Browse the repository at this point in the history
Chore: fix react 18, update linter & stories, update deps
  • Loading branch information
rpearce committed May 25, 2022
2 parents 58aa24a + d2ebc32 commit 9b540d8
Show file tree
Hide file tree
Showing 13 changed files with 6,871 additions and 8,513 deletions.
67 changes: 12 additions & 55 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,89 +1,46 @@
module.exports = {
env: {
browser: true,
es6: true,
es2021: true,
jest: true,
node: true,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'standard',
'plugin:@typescript-eslint/recommended',
'plugin:jsx-a11y/recommended',
],
overrides: [],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'react',
'react-hooks',
'jest',
'jsx-a11y',
'@typescript-eslint',
],
rules: {
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-use-before-define': 'off',
'comma-dangle': ['error', {
arrays: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
imports: 'always-multiline',
objects: 'always-multiline',
}],
curly: ['error', 'all'],
eqeqeq: ['error', 'always', { null: 'ignore' }],
'eol-last': 'error',
indent: ['error', 2, { 'SwitchCase': 1 }],
'jsx-quotes': ['error', 'prefer-double'],
'jsx-a11y/no-onchange': 'off', // https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/398
'keyword-spacing': 'error',
'linebreak-style': ['error', 'unix'],
'max-len': [
'error',
{
code: 80,
ignoreComments: true,
ignoreTemplateLiterals: true,
ignoreStrings: true,
},
],
'no-trailing-spaces': 'error',
'no-use-before-define': ['error', {
functions: false,
classes: true,
variables: false,
}],
'object-curly-spacing': ['error', 'always'],
quotes: ['error', 'single', { allowTemplateLiterals: true }],
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
'react/jsx-curly-spacing': ['error', { children: true }],
'react/jsx-no-undef': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
semi: ['error', 'never'],
'space-in-parens': ['error', 'never'],
'space-infix-ops': ['error'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'react/prop-types': 0,
'space-before-function-paren': 'off',
'spaced-comment': 'off',
},
settings: {
react: {
version: 'detect',
},
},
overrides: [
{
files: ['*.js', '*.jsx'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
],
}
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DS_Store
coverage
dist
docs
node_modules
coverage/
dist/
docs/
node_modules/
4 changes: 2 additions & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
addons: [
'@storybook/addon-a11y',
'@storybook/addon-knobs',
'@storybook/addon-controls',
],
stories: ['../source/stories.tsx'],
stories: ['../stories/index.tsx'],
}
5 changes: 5 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { addons } from '@storybook/addons'

addons.setConfig({
panelPosition: 'right',
})
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [2.3.5] - 2022-05-23

### Changed

* Updated `tslib` compat to be `^2.4.0`

### Fixed

* Support for React 18
* Updated `react-with-forwarded-ref` to solve legacy peer deps issue

## [2.3.5] - 2022-03-02

### Fixed
Expand Down
1 change: 0 additions & 1 deletion __tests__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { CSSProperties, createRef } from 'react'
import { fireEvent, render } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import ExpandingTextarea, { getHeight, resize } from '../source'

test('renders with a minimum number of rows', () => {
Expand Down
Loading

0 comments on commit 9b540d8

Please sign in to comment.