You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating this issue as a discussion space on how we might decouple our Eslint config from library-specific dependencies.
The Problem
Currently, our eslint config is based on the airbnb config, which provides lots of useful things for React projects, but adds complications if you want to use the Sparkbox configuration on non-React projects. Without installing the React specific peer dependencies, you'll see warnings like:
Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.
There is a very hacky fix for this, by adding the following to .eslintrc:
But obviously that is not optimal if we'd like to use this config for client projects that might not be using React.
Potential Solutions
Could we use extends to create a more modular structure for our eslint config(s)? For example, if we had the following configurations:
eslint-config-sparkbox
eslint-config-sparkbox-react
eslint-config-sparkbox-vue
☝️ the React and Vue specific configs could both inherit from the base eslint-config-sparkbox config. However, in order to do this, we'd probably need to remove our dependence on the airbnb config, or switch to using the base airbnb config as a starting point
The text was updated successfully, but these errors were encountered:
Creating this issue as a discussion space on how we might decouple our Eslint config from library-specific dependencies.
The Problem
Currently, our eslint config is based on the airbnb config, which provides lots of useful things for React projects, but adds complications if you want to use the Sparkbox configuration on non-React projects. Without installing the React specific peer dependencies, you'll see warnings like:
There is a very hacky fix for this, by adding the following to
.eslintrc
:But obviously that is not optimal if we'd like to use this config for client projects that might not be using React.
Potential Solutions
Could we use
extends
to create a more modular structure for our eslint config(s)? For example, if we had the following configurations:eslint-config-sparkbox
eslint-config-sparkbox-react
eslint-config-sparkbox-vue
☝️ the React and Vue specific configs could both inherit from the base
eslint-config-sparkbox
config. However, in order to do this, we'd probably need to remove our dependence on the airbnb config, or switch to using the base airbnb config as a starting pointThe text was updated successfully, but these errors were encountered: