Skip to content

Commit

Permalink
fix: simplify configs
Browse files Browse the repository at this point in the history
The previous attempt added unneeded additional complexity,
to the point where it broke using the configurations.
  • Loading branch information
nikku committed Oct 9, 2024
1 parent 90abb64 commit 9be702a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 29 deletions.
17 changes: 7 additions & 10 deletions configs/browser.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import { merge } from 'min-dash';

import globals from 'globals';

import recommended from './recommended.js';

export default [
...recommended.map((config) => {
return merge({}, config, {
languageOptions: {
globals: {
...globals.browser
}
...recommended,
{
languageOptions: {
globals: {
...globals.browser
}
});
}),
}
},
{
rules: {
'no-restricted-imports': ['error', {
Expand Down
7 changes: 1 addition & 6 deletions configs/jsx.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import reactPlugin from 'eslint-plugin-react';

export default [
reactPlugin.configs.flat.recommended,
{
languageOptions: {
...reactPlugin.configs.flat.recommended.languageOptions
},
plugins: {
react: reactPlugin
},
rules: {
'jsx-quotes': ['error', 'prefer-double'],
'react/jsx-curly-spacing': ['error', { when: 'always' }],
Expand Down
4 changes: 1 addition & 3 deletions configs/mocha.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import mochaPlugin from 'eslint-plugin-mocha';

export default [
mochaPlugin.configs.flat.recommended,
{
plugins: {
mocha: mochaPlugin
},
rules: {
'mocha/no-exclusive-tests': 'error'
}
Expand Down
17 changes: 7 additions & 10 deletions configs/node.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { merge } from 'min-dash';

import globals from 'globals';

import recommended from './recommended.js';

export default [
...recommended.map((config) => {
return merge({}, config, {
languageOptions: {
globals: {
...globals.node
}
...recommended,
{
languageOptions: {
globals: {
...globals.node
}
});
})
}
}
];

0 comments on commit 9be702a

Please sign in to comment.