1.2.1 • Published 7 years ago

eslint-config-swift v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

eslint-config-swift

eslint config used by Swift for frontend apps; based on airbnb's eslint config, but stricter.

Usage

npm install --save-dev eslint-config-swift

Then you need to install plugins required for our config and airbnb's:

(
  export PKG=eslint-config-swift;
  npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"
  export PKG=eslint-config-airbnb;
  npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"
  export PKG=eslint-config-airbnb-base;
  npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"
)

In your own .eslintrc, you can include the "universal" config for React/Redux apps or "electron" for Electron apps:

{
  "extends": "swift/universal"
}

or

{
  "extends": "swift/electron"
}

And you probably want this in your package.json:

{
  "scripts": {
    ...
    "lint": "eslint -c .eslintrc --ext .jsx,.js list of source directories"
    ...
  }
}

webpack resolution

For the webpack import resolver to work, webpack.config.js must be in the filesystem adjacent to your package.json.

You probably want it to look something like this:

// here for eslint-import-resolver-webpack
require('babel-register');
module.exports = require('./webpack.config.development.js');
1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago