Skip to content

Commit

Permalink
General updates and ESLint update.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanb committed Jul 30, 2024
1 parent 46e11da commit 9412765
Show file tree
Hide file tree
Showing 21 changed files with 505 additions and 647 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions eslint-base-node.json

This file was deleted.

283 changes: 0 additions & 283 deletions eslint-base.json

This file was deleted.

40 changes: 16 additions & 24 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import promisePlugin from 'eslint-plugin-promise'
import reactPlugin from 'eslint-plugin-react'
import stylistic from '@stylistic/eslint-plugin'
import nodePlugin from 'eslint-plugin-n'
import globals from 'globals'
Expand Down Expand Up @@ -58,8 +57,7 @@ export default [
*/
{
plugins: {
promise: promisePlugin,
react: reactPlugin
promise: promisePlugin
},
languageOptions: {
ecmaVersion: 2023, // Targeted ES
Expand All @@ -81,21 +79,16 @@ export default [
afterEach: false,
test: false,
expect: false,
should: false
should: false
}
}
},

/**
* Rules configuration; we start with the recommended and then follow with overrides.
*/
* Rules configuration; we start with the recommended and then follow with overrides.
*/
rules: {
...promisePlugin.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...reactPlugin.configs['jsx-runtime'].rules,

'n/no-unsupported-features/es-syntax': 'off', // We're mixing ESM and CJS with controls around the Node 10 runtime.


// Overrides and additions
'promise/always-return': ['error', { ignoreLastCallback: true }],
Expand All @@ -106,23 +99,20 @@ export default [
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}]
},
}],

settings: {
react: {
version: 'detect' // You can add this if you get a warning about the React version when you lint
}
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off'
}
},

{
files: ['**/*.(test|spec).(mj|j|t|cj|ct|mt)s', '**/test-runner/**/*', '**/test-runner-core/**/*'],
rules: {
'@stylistic/max-statements-per-line': ['error', { max: 2 }],
'@typescript-eslint/no-var-requires': 'off'
}
},
{
files: ['**/*.(test|spec).(mj|j|t|cj|ct|mt)s', '**/test-runner/**/*', '**/test-runner-core/**/*'],
rules: {
'@stylistic/max-statements-per-line': ['error', { max: 2 }],
'@typescript-eslint/no-var-requires': 'off'
}
},

// applies to only Node project files referenced above.
{
Expand All @@ -136,6 +126,8 @@ export default [
rules: {
...nodePlugin.configs['flat/recommended'].rules,

'n/no-unsupported-features/es-syntax': 'off', // We're mixing ESM and CJS with controls around the Node 10 runtime.

'n/no-extraneous-import': ['error', {
allowModules: [...monoRepoPackages]
}]
Expand Down
Loading

0 comments on commit 9412765

Please sign in to comment.