New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-squarespace

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-squarespace

Eslint shareable configuration for Squarespace

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
increased by125%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-squarespace

Provides the universal configuration for eslint at Squarespace.

Installation

Without React

$ npm install --save-dev eslint-config-squarespace babel-eslint

Then:

add "extends": "eslint-config-squarespace" to your .eslintrc

Example .eslintrc
{
  "extends": "eslint-config-squarespace/vanilla",
  "env": {
    "browser": true,
    "mocha": true,
    "node": true
  }
}

With React

$ npm install --save-dev eslint-config-squarespace babel-eslint eslint-plugin-react
Example .eslintrc
{
  "extends": "squarespace",
  "env": {
    "browser": true,
    "mocha": true,
    "node": true
  },
  "plugins": [
    "react"
  ]
}

Integrating with Webpack

You may add eslint config to a webpack build process by using a preloader and some eslint config. There should be no need to reference this config file provided the .eslintrc 'extends' property is set.

$ npm install --save eslint-loader
// webpack.config.js
module: {
  eslint: {
    configFile: path.join(pathsToESlint, '.eslintrc'),
    failOnError: true
  },
  module: {
    preLoaders: [
      {
        test: /\.jsx?$/,
        loader: 'eslint',
        include: pathsToFiles
      }
    ],
    ..
  }

Troubleshooting

Webpack

The webpack plugin for pre-linting is notoriously slow, because it can not leverage and form of caching available to either eslint or webpack. If it is too slow, try moving it to the npm command that starts the webpack build.

Global Eslint

Global CLI installations of eslint cannot find local modules. This is expected behavior. Tools or scripts that rely on such global installations must be rewritten or modified to find the correct node_modules folder.

Fix Syntastic for Vim

If you are using syntastic, adding the following to your .vimrc should fix eslint.

" Kludge to fix global/local.
let g:syntastic_javascript_checkers = ['eslint']

let local_eslint = finddir('node_modules', '.;') . '/.bin/eslint'
if matchstr(local_eslint, "^\/\\w") == ''
    let local_eslint = getcwd() . "/" . local_eslint
endif
if executable(local_eslint)
    let g:syntastic_javascript_eslint_exec = local_eslint
endif

License

Apache-2 copyright Squarespace

Keywords

FAQs

Package last updated on 19 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc