GithubHelp home page GithubHelp logo

eslint-plugin-import-order-autofix's People

Contributors

alexjuarez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eslint-plugin-import-order-autofix's Issues

--fix removes react-fontawesome

When using the --fix option my react-fontawesome import was deleted ...
Settings

"import-order-autofix/order": ["error", {"newlines-between": "always"}]

Original

import PropTypes from 'prop-types';
import React, {Component} from 'react';
import {withRouter} from 'react-router';

import {Nav, NavItem} from 'react-bootstrap';
import StudyToolbarItem from './study-life-cycle-item.jsx';
import STUDY_PHASE_STATUS_TYPES from '../../../models/constants/study-phase-status-types';
import FontAwesome from 'react-fontawesome';

After Fix

import PropTypes from 'prop-types';
import React, {Component} from 'react';
import {withRouter} from 'react-router';
import {Nav, NavItem} from 'react-bootstrap';

import STUDY_PHASE_STATUS_TYPES from '../../../models/constants/study-phase-status-types';

import StudyToolbarItem from './study-life-cycle-item.jsx';

Typescript error

When using with typescript I get

Error: did not recognize object of type "TSTypeAliasDeclaration"

ESLint can't find the plugin

#Hi Alex, thanks for all your hard work!

Unfortunately, I can't seem to get this to work. I keep getting this error when I try to run my linter:

ESLint couldn't find the plugin "eslint-plugin-import-order-autofix". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-import-order-autofix is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm i eslint-plugin-import-order-autofix@latest --save-dev

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

Of course, I've made sure to check the suggestions.

The eslint plugin is installed and present in node_modules:

// in package.json

    "eslint": "^3.14.1",
    "eslint-config-airbnb": "^14.0.0",
    "eslint-import-resolver-webpack": "^0.8.1",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-import-order-autofix": "^0.8.3",
    "eslint-plugin-jsx-a11y": "^3.0.2",
    "eslint-plugin-react": "^6.9.0",

The rule is added to the ESlint config:

// in .esintrc

{
  "plugins": [
    "react",
    "jsx-a11y",
    "import-order-autofix"
  ],
  "rules": {
    "react/no-array-index-key": 1,
    "import-order-autofix/order": 1
  }
}

I've made sure to run the local ESlint:

./node_modules/.bin/eslint --fix --ext .jsx,.js .

I've tried removing the node_modules folder. I've also tried installing ESlint and this plugin globally, but keep getting the same error.

Do you perhaps know something else I can try?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.