babel-jscs
raw JSON → 3.0.0-beta1 verified Sat Apr 25 auth: no javascript deprecated
babel-jscs allows linting all valid Babel code with JSCS by providing a custom parser (esprima) that monkeypatches JSCS to support Babel syntax. The package is experimental, last released as 3.0.0-beta1, and is intended to be integrated into JSCS itself via the --esnext flag. It is not actively maintained and is superseded by ESLint and babel-eslint. Key differentiator: enables Babel syntax support for JSCS users before JSCS natively supported it.
Common errors
error SyntaxError: Unexpected token import ↓
cause JSCS parser does not understand ES modules without babel-jscs.
fix
Use babel-jscs with { "esnext": true } or use ESLint with babel-eslint.
Warnings
gotcha Requires a specific JSCS version (pre-2.0) to work; not compatible with JSCS 2.x+ without monkeypatching. ↓
fix Use babel-eslint instead, or JSCS 1.x with the esnext option.
deprecated This package is no longer maintained; JSCS has been retired in favor of ESLint. ↓
fix Migrate to ESLint with babel-eslint or @babel/eslint-parser.
Install
npm install babel-jscs yarn add babel-jscs pnpm add babel-jscs Imports
- babel-jscs (as eslint plugin) wrong
Trying to import babel-jscs as a module in codecorrectUse via JSCS config: { "esnext": true }
Quickstart
npm install -g jscs babel-jscs
# In your project root, create .jscsrc:
echo '{"esnext": true}' > .jscsrc
# Lint a file:
jscs myfile.js
# Or without config file:
jscs myfile.js --esnext