score:13
as @mark-willian told me, i added some lines in my .eslintrc and it works:
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "airbnb",
"parser": "babel-eslint",
"rules": {
"indent": [2, "tab", { "switchcase": 1, "variabledeclarator": 1 }],
"no-tabs": 0,
"react/prop-types": 0,
"react/jsx-indent": [2, "tab"],
"react/jsx-indent-props": [2, "tab"],
}
}
thank you for all of your answers.
score:0
try replace every tab to spaces.
it is also a good idea to enable the eslint autofix feature with this eslint-loader
option in your webpack configuration.
score:0
you can add this comment on page which you get no-tabs error.
/* eslint-disable */
score:2
the airbnb rules want you to use spaces instead of tabs for formatting your code. good editors (sublime is one!) will let you use tabs but translate them to spaces when saving your code.
you need to change the config of your sublime; go to preferences-settings and customize the following settings:
"tab_size": 2,
"translate_tabs_to_spaces": true
sublime will convert your existing code - click on the text in the status bar at the bottom right that says tabs or spaces.
you can selectively turn off eslint rules if (for example) one of airbnb's rules doesn't match your coding style guide.
Source: stackoverflow.com
Related Query
- Use ESLint with Airbnb style and tab (React.js)
- Setting up Airbnb ESLint with React and Webpack
- how to use nav link in react with router and bootstrap style
- How to use React with Typescript and SASS
- Why does production build of React app (with Webpack and Babel) use wrong development env with HMR, which causes errors?
- How to use vw and vh css with React Native
- Use inline style in React with plain CSS string
- How to use Django User Groups and Permissions on a React Frontend with Django Rest Framework
- Installing Babel to use with React and JSX
- How to solve, craco: *** Cannot find ESLint loader (eslint-loader). *** error with ANTd and React (2021)
- How to use Jest with React and Webpack
- How to use srcset 2x with React and Webpack?
- How to use inheritance with React components and es6 classes
- React Router v5 accompanied with Code Splitting, and Data Prefetching with the use of Server Side Rendering
- `Invalid mapping` error trying to use babel require hook and polyfill with react jsx transpile
- Use onFocus on a div with React and Typescript
- How to use emotion/styled with React and Typescript
- Can I use third-party libraries with React and TypeScript?
- How to use setTimeout() along with React Hooks useEffect and setState?
- How to Use SVG with React and ReasonML?
- React JS - ESLint - Rules for ignoring components with UNSAFE_componentWillMount, UNSAFE_componentWillUpdate, and UNSAFE_componentWillReceiveProps
- Use Owl Carousel 2 with next.js and react
- How to use Mapbox GL with React and Redux?
- what is the best way to use react router V6 navigation with redux and redux thunk actions?
- how to map an array of images and use it as inline style in React
- Is it possible to use MaterialUI with React and css modules and access the theme inside the css module file?
- Difference and use cases with useEffect and useMemo hooks on React
- How to use Material-UI with React and ASP.net MVC
- Cannot create custom style with React and Bootstrap
- How do I use types defined by @types/redux-form in React component with Field and FieldArray?
More Query from same tag
- React Native + Firestore infinite loop, using hooks
- Can't push/update data into existing mongo object
- Setting up Promise for two API calls in UseEffect
- Effective onBlur for react-data-grid
- How can I get `vis.js` `vis-network` to run on React.js?
- How do I detect when FlatList has rendered all items and actually scrolled to bottom?
- Reactjs child component goes into infinite loop on setting state array provided by parent in props
- React router not redirects pragmatically
- React portal event bubbling in the wrong direction
- Not setting state with data get back from fetch call
- Using Socket.io with React using properties how to properly manage lifespan
- Render component in Drawer with Material-ui Lists
- How do I restrict the type of React Children in TypeScript, using the newly added support in TypeScript 2.3?
- Using IndexRoute to set up a Landing Page in my React App
- useSelector is not able to export from 'react-redux'
- React - How to add onclick function to buttons in each row in Datatables
- React App on Fargate is ignoring env variable
- beautiful dnd - passing draggable data onDropEnd
- How to navigate to another component and pass data
- Getting working directory and file name in react & webpack
- Delete `␍`eslintprettier/prettier
- ElasticSearch API with React App giving Unauthorized (401) on a search rqeuest
- Using Netlify lambda functions to send emails from a GatsbyJS site
- Mocking up data in React Components
- How to use ant design in server side rendering?
- how can I keep song playing in reactjs even if I go to another page(of same website)
- Change handlers in react hooks
- ReactJS - Pass parameter from blade to JSX
- material ui input base auto focus doesnt work
- mern - updated values are null in data