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

Commit 9b540d8

Browse files
authored
Merge pull request #88 from rpearce/chore/react-18-and-build
Chore: fix react 18, update linter & stories, update deps
2 parents 58aa24a + d2ebc32 commit 9b540d8

File tree

13 files changed

+6871
-8513
lines changed

13 files changed

+6871
-8513
lines changed

.eslintrc.js

Lines changed: 12 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,46 @@
11
module.exports = {
22
env: {
33
browser: true,
4-
es6: true,
4+
es2021: true,
55
jest: true,
66
node: true,
77
},
88
extends: [
9-
'plugin:@typescript-eslint/recommended',
109
'plugin:react/recommended',
10+
'standard',
11+
'plugin:@typescript-eslint/recommended',
1112
'plugin:jsx-a11y/recommended',
1213
],
13-
overrides: [],
14+
parser: '@typescript-eslint/parser',
1415
parserOptions: {
15-
ecmaVersion: 2020,
16+
ecmaFeatures: {
17+
jsx: true,
18+
},
19+
ecmaVersion: 'latest',
1620
sourceType: 'module',
1721
},
18-
parser: '@typescript-eslint/parser',
1922
plugins: [
20-
'@typescript-eslint',
2123
'react',
2224
'react-hooks',
23-
'jest',
24-
'jsx-a11y',
25+
'@typescript-eslint',
2526
],
2627
rules: {
27-
'@typescript-eslint/no-unused-vars': 'error',
28-
'@typescript-eslint/no-use-before-define': 'off',
2928
'comma-dangle': ['error', {
3029
arrays: 'always-multiline',
3130
exports: 'always-multiline',
3231
functions: 'ignore',
3332
imports: 'always-multiline',
3433
objects: 'always-multiline',
3534
}],
36-
curly: ['error', 'all'],
37-
eqeqeq: ['error', 'always', { null: 'ignore' }],
38-
'eol-last': 'error',
39-
indent: ['error', 2, { 'SwitchCase': 1 }],
40-
'jsx-quotes': ['error', 'prefer-double'],
41-
'jsx-a11y/no-onchange': 'off', // https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/398
42-
'keyword-spacing': 'error',
43-
'linebreak-style': ['error', 'unix'],
44-
'max-len': [
45-
'error',
46-
{
47-
code: 80,
48-
ignoreComments: true,
49-
ignoreTemplateLiterals: true,
50-
ignoreStrings: true,
51-
},
52-
],
53-
'no-trailing-spaces': 'error',
54-
'no-use-before-define': ['error', {
55-
functions: false,
56-
classes: true,
57-
variables: false,
58-
}],
59-
'object-curly-spacing': ['error', 'always'],
60-
quotes: ['error', 'single', { allowTemplateLiterals: true }],
6135
'react-hooks/exhaustive-deps': 'error',
6236
'react-hooks/rules-of-hooks': 'error',
63-
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
64-
'react/jsx-curly-spacing': ['error', { children: true }],
65-
'react/jsx-no-undef': 'error',
66-
'react/jsx-uses-react': 'error',
67-
'react/jsx-uses-vars': 'error',
68-
semi: ['error', 'never'],
69-
'space-in-parens': ['error', 'never'],
70-
'space-infix-ops': ['error'],
71-
'no-use-before-define': 'off',
72-
'@typescript-eslint/no-use-before-define': ['error'],
37+
'react/prop-types': 0,
38+
'space-before-function-paren': 'off',
39+
'spaced-comment': 'off',
7340
},
7441
settings: {
7542
react: {
7643
version: 'detect',
7744
},
7845
},
79-
overrides: [
80-
{
81-
files: ['*.js', '*.jsx'],
82-
rules: {
83-
'@typescript-eslint/explicit-function-return-type': 'off',
84-
'@typescript-eslint/explicit-module-boundary-types': 'off',
85-
'@typescript-eslint/no-var-requires': 'off',
86-
},
87-
},
88-
],
8946
}

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DS_Store
2-
coverage
3-
dist
4-
docs
5-
node_modules
2+
coverage/
3+
dist/
4+
docs/
5+
node_modules/

.storybook/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
addons: [
33
'@storybook/addon-a11y',
4-
'@storybook/addon-knobs',
4+
'@storybook/addon-controls',
55
],
6-
stories: ['../source/stories.tsx'],
6+
stories: ['../stories/index.tsx'],
77
}

.storybook/manager.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { addons } from '@storybook/addons'
2+
3+
addons.setConfig({
4+
panelPosition: 'right',
5+
})

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [2.3.5] - 2022-05-23
9+
10+
### Changed
11+
12+
* Updated `tslib` compat to be `^2.4.0`
13+
14+
### Fixed
15+
16+
* Support for React 18
17+
* Updated `react-with-forwarded-ref` to solve legacy peer deps issue
18+
819
## [2.3.5] - 2022-03-02
920

1021
### Fixed

__tests__/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { CSSProperties, createRef } from 'react'
22
import { fireEvent, render } from '@testing-library/react'
33
import '@testing-library/jest-dom/extend-expect'
44

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

87
test('renders with a minimum number of rows', () => {

0 commit comments

Comments
 (0)