Skip to content

Commit

Permalink
Eslint Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgio committed Jan 30, 2025
1 parent f334303 commit 6928e70
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 86 deletions.
47 changes: 0 additions & 47 deletions .eslintrc

This file was deleted.

66 changes: 66 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
module.exports = {
env: {
browser: true,
jest: true,
},
extends: [
'@ericgio/eslint-config-react',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
globals: {},
overrides: [
{
files: ['**/*'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'import/extensions': 'off',
'no-shadow': 'off',
'no-use-before-define': 'off',
'react/jsx-no-bind': 'off',
},
},
{
files: ['**/*.stories.tsx'],
rules: {
'import/no-extraneous-dependencies': 'off',
'sort-keys': 'off',
},
},
{
files: ['**/*.mjs'],
rules: {
'import/no-extraneous-dependencies': 'off',
'no-console': 'off',
'no-underscore-dangle': 'off',
},
},
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/no-shadow': 2,
'@typescript-eslint/no-unused-vars': [
2,
{ args: 'after-used', ignoreRestSiblings: true, vars: 'all' },
],
'@typescript-eslint/no-use-before-define': 'error',
'react/jsx-filename-extension': [
1,
{
extensions: ['.js', '.jsx', '.tsx'],
},
],
'react/jsx-fragments': [2, 'syntax'],
'react/static-property-placement': [2, 'static public field'],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
};
2 changes: 0 additions & 2 deletions scripts/__dirname.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-underscore-dangle */

import path from 'path';
import { fileURLToPath } from 'url';

Expand Down
3 changes: 0 additions & 3 deletions scripts/buildCSS.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env node

/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable no-console */

import chalk from 'chalk';
import fs from 'fs';
import path from 'path';
Expand Down
3 changes: 0 additions & 3 deletions scripts/buildModules.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env node

/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable no-console */

import chalk from 'chalk';
import { execa } from 'execa';
import path from 'path';
Expand Down
3 changes: 0 additions & 3 deletions scripts/deployExample.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env node

/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable no-console */

import ghpages from 'gh-pages';
import pkg from '../package.json' assert { type: 'json' };

Expand Down
2 changes: 0 additions & 2 deletions src/components/ClearButton/ClearButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React from 'react';
import { Meta, StoryFn } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Highlighter/Highlighter.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Hint/Hint.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React, { useState } from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Input/Input.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Loader/Loader.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Menu/Menu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/MenuItem/BaseMenuItem.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/MenuItem/MenuItem.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Overlay/Overlay.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React, { useState } from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Token/Token.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Typeahead/Typeahead.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import cx from 'classnames';
import React, { useState } from 'react';
import { StoryFn, Meta } from '@storybook/react';
Expand Down
1 change: 1 addition & 0 deletions src/components/Typeahead/Typeahead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const propTypes = {
* Props to be applied directly to the input. `onBlur`, `onChange`,
* `onFocus`, and `onKeyDown` are ignored.
*/
// eslint-disable-next-line react/forbid-prop-types
inputProps: checkPropType(PropTypes.object, inputPropsType),
/**
* Bootstrap 4 only. Adds the `is-invalid` classname to the `form-control`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React, { ChangeEvent, useState } from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React, { useState } from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down
2 changes: 0 additions & 2 deletions src/components/TypeaheadMenu/TypeaheadMenu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable sort-keys,import/no-extraneous-dependencies */

import React from 'react';
import { StoryFn, Meta } from '@storybook/react';

Expand Down

0 comments on commit 6928e70

Please sign in to comment.