Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

4 changes: 4 additions & 0 deletions eslint-configs/eslint-config-seekingalpha-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 9.0.0 - 2025-03-09

- [breaking] migrate to ESM and make flat config default

## 8.0.0 - 2025-03-07

- [new] expose flat config
Expand Down
25 changes: 15 additions & 10 deletions eslint-configs/eslint-config-seekingalpha-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,31 @@ Install ESLint and all [Peer Dependencies](https://nodejs.org/en/blog/npm/peer-d

Install SeekingAlpha shareable ESLint:

npm install eslint-config-seekingalpha-react --save-dev
npm install eslint-config-seekingalpha-react@latest --save-dev

## Usage

This shareable config includes all ESLint rules including ECMAScript 6 features, set of [legacy rules](https://eslint.org/docs/rules/#deprecated) and additional rules for `React` We also extend our configuration with following plugins:
This shareable config includes all rules from following plugins:

- [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react)
- [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y)
- [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)

If you don't need configuration extended with `React` rules, check out our [base config](https://www.npmjs.com/package/eslint-config-seekingalpha-base).

Simply [extend](https://eslint.org/docs/user-guide/configuring#extending-configuration-files) the relevant .eslintrc.js configuration in your project with `seekingalpha-react` rules:
Simply [use](https://eslint.org/docs/latest/extend/shareable-configs) the eslint.config.js in your project with the configuration:

```javascript
{
extends: [
'seekingalpha-react'
]
}
import reactConfig from 'eslint-config-seekingalpha-react';

export default [
{
plugins: {
...reactConfig.plugins,
},
rules: {
...reactConfig.rules,
},
},
];
```

## License
Expand Down
16 changes: 0 additions & 16 deletions eslint-configs/eslint-config-seekingalpha-react/flat.js

This file was deleted.

32 changes: 13 additions & 19 deletions eslint-configs/eslint-config-seekingalpha-react/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
module.exports = {
extends: [
// https://github.com/yannickcr/eslint-plugin-react
'./rules/eslint-plugin-react/index.js',
import jsxA11yConfig from './rules/eslint-plugin-jsx-a11y/index.js';
import reactConfig from './rules/eslint-plugin-react/index.js';
import reactHooksConfig from './rules/eslint-plugin-react-hooks/index.js';

// https://github.com/evcohen/eslint-plugin-jsx-a11y
'./rules/eslint-plugin-jsx-a11y/index.js',

// https://reactjs.org/docs/hooks-rules.html
'./rules/eslint-plugin-react-hooks/index.js',
],

parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
ecmaFeatures: {
impliedStrict: true,
globalReturn: false,
jsx: true,
},
export default {
plugins: {
...jsxA11yConfig.plugins,
...reactConfig.plugins,
...reactHooksConfig.plugins,
},
rules: {
...jsxA11yConfig.rules,
...reactConfig.rules,
...reactHooksConfig.rules,
},
};
3 changes: 2 additions & 1 deletion eslint-configs/eslint-config-seekingalpha-react/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "eslint-config-seekingalpha-react",
"version": "8.0.0",
"version": "9.0.0",
"description": "SeekingAlpha's sharable React.js ESLint config",
"main": "index.js",
"type": "module",
"scripts": {
"eslint-find-rules": "eslint-find-rules -u ./index.js",
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
jsxIndent: 2,
jsxIndentProps: 2,
jsxMaxDepth: 10,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//

module.exports = {
plugins: ['jsx-a11y'],
import jsxA11y from 'eslint-plugin-jsx-a11y';

Check failure on line 1 in eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-jsx-a11y/index.js

View workflow job for this annotation

GitHub Actions / Lint

Unable to resolve path to module 'eslint-plugin-jsx-a11y'

Check failure on line 1 in eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-jsx-a11y/index.js

View workflow job for this annotation

GitHub Actions / Lint

Can't resolve 'eslint-plugin-jsx-a11y' in '/home/runner/work/javascript/javascript/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-jsx-a11y'

export default {
plugins: {
'jsx-a11y': jsxA11y,
},
rules: {
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md
'jsx-a11y/alt-text': [
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
plugins: ['react-hooks'],
import reactHooksPlugin from 'eslint-plugin-react-hooks';

Check failure on line 1 in eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react-hooks/index.js

View workflow job for this annotation

GitHub Actions / Lint

Unable to resolve path to module 'eslint-plugin-react-hooks'

Check failure on line 1 in eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react-hooks/index.js

View workflow job for this annotation

GitHub Actions / Lint

Can't resolve 'eslint-plugin-react-hooks' in '/home/runner/work/javascript/javascript/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react-hooks'

export default {
plugins: {
'react-hooks': reactHooksPlugin,
},
rules: {
// React Hooks Plugin https://www.npmjs.com/package/eslint-plugin-react-hooks

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
module.exports = {
plugins: ['react'],
import reactPlugin from 'eslint-plugin-react';

Check failure on line 1 in eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/index.js

View workflow job for this annotation

GitHub Actions / Lint

Unable to resolve path to module 'eslint-plugin-react'

Check failure on line 1 in eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/index.js

View workflow job for this annotation

GitHub Actions / Lint

Can't resolve 'eslint-plugin-react' in '/home/runner/work/javascript/javascript/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react'

extends: ['./react.js', './jsx.js'],
import jsxConfig from './jsx.js';
import reactConfig from './react.js';

export default {
plugins: {
react: reactPlugin,
},
rules: {
...jsxConfig.rules,
...reactConfig.rules,
},
};
Loading