README
ESLint Config
The files in this directory represent the eslint configuration settings
for Varnish.
They're packaged as such so that they can be published as a separate NPM module,
@allenai/eslint-config-varnish. This allows them to be shared easily
across multiple AI2 projects.
For more information about publishing and using shared eslint configuration
definitions, see this documentation.
Usage
Install it and it's peer dependencies:
~ yarn add @allenai/eslint-config-varnish \ @typescript-eslint/eslint-plugin \ @typescript-eslint/parser \ eslint \ eslint-config-prettier \ eslint-config-standard \ eslint-plugin-import \ eslint-plugin-mdx \ eslint-plugin-node \ eslint-plugin-prettier \ eslint-plugin-promise \ eslint-plugin-react \ eslint-plugin-standard \ prettierCreate a file with patterns specifying stuff you'd like to ignore:
~ cat <<EOF > .eslintignore .next/ node_modules/ package.json tsconfig.json EOFCreate a config file, and configure
eslintto use this package as a base:cat <<EOF > .eslintrc.js module.exports = { extends: [ "@allenai/eslint-config-varnish" ] }; EOFAdd targets for linting and reformatting code to your
package.jsonfile:"scripts": { "lint": "eslint '**/*.{js,ts,tsx,json}' && echo '💫 Lint complete.'", "lint:fix": "eslint '**/*.{js,ts,tsx,json}' --fix && echo '🛠 Lint --fix complete.'", }Try it out:
# See what's wrong ~ yarn lint # Reformat and fix things ~ yarn lint:fix
Publishing
See instructions at the monorepo root README
🤘 ⛵️ 🎨