Giter Club home page Giter Club logo

lintier's Introduction

Lintier

E2E Test Status Version Downloads Last commit

Lintier is a CLI to quickly scaffold an ESLint & Prettier setup in a TypeScript project. Because linting and code formatting are a must, but setup is a pain.

Lintier works in React, Node, and vanilla Typescript projects. It provides options to install the airbnb styleguide, stylelint for linting styles, and lint-staged for linting pre-commit. Lintier will install the dependencies, create the config files, and add linting scripts to your package.json file.

Lintier's goal is to provide a minimal setup to build upon. A few rules are included by default, but you should modify the config files to fit your project's needs.

Usage

Just run npx lintier in your project's directory. Linter will start in interactive mode, letting you choose your project type and configuration.

Alternately, you can specify any of the options below to skip the interactive prompts:

Options Description
-r, --react install react dependencies
-n, --node install node dependencies
-a, --airBnb install airbnb styleguide
-s, --styleLint install stylelint
-c, --styledComponents install styled-components lint script
-p, --sass install sass stylelint config & lint script
-l, --lintStaged install lint-staged and simple-git-hooks
--help display help for command
-V, --version output the version number

A Note on Styled-Components

The styled-components option just adds .ts/.js files to the package.json script to lint styles. The stylelint config mentioned in the styled-components docs seems to conflict with this eslint setup, so I left it out for now.

Troubleshooting

Lintier installs the latest version of the various dependencies, and versions are not pinned. This helps me keep the package up-to-date as I use it, but it also means breaking changes in those dependencies can break lintier. A weekly scheduled end-to-end test is also setup to help catch these changes.

If you spot trouble, please open an issue in the GitHub repo.

Contributing

Pull requests are welcome! The goal is to keep lintier minimalist, so please minimize any additional rules enabled and options presented to the user.

lintier's People

Contributors

josh-stillman avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

s0pex

lintier's Issues

Setup fails due to eslint-plugin-import@"^2.25.3" from [email protected] dependency error

Hey,

it seems like the e2e test work fine but npx linter fails on a fresh project that just had npm init run before.
The error is that it seems that eslint-plugin-import and eslint-config-airbnb-typescript can fully resolve the dependencies.

Edit: When using yarn yarn init and then ending a random dep so that yarn.lock is created npx linter works without any issues, seems to be an npm issue?
Log:

PS A:\Git\Notification-Bot> npx lintier
? Install which plugins? Node
? Install AirBnb Style Guide Config? Yes
? Install lint-staged? Yes
โœ” Installing dependencies...
/ Installing airbnb...Error: Command failed with exit code 1: npm install eslint-config-airbnb-typescript -E -D
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint-plugin-import
npm ERR!   dev eslint-plugin-import@"2.25.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-import@"^2.25.3" from [email protected]
npm ERR! node_modules/eslint-config-airbnb-typescript
npm ERR!   dev eslint-config-airbnb-typescript@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Artur\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Artur\AppData\Local\npm-cache\_logs\2022-04-16T12_25_21_182Z-debug-0.log
    at makeError (C:\Users\Artur\AppData\Local\npm-cache\_npx\c474b1945def7d56\node_modules\execa\lib\error.js:59:11)
    at handlePromise (C:\Users\Artur\AppData\Local\npm-cache\_npx\c474b1945def7d56\node_modules\execa\index.js:114:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  shortMessage: 'Command failed with exit code 1: npm install eslint-config-airbnb-typescript -E -D',
  command: 'npm install eslint-config-airbnb-typescript -E -D',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'npm ERR! code ERESOLVE\n' +
    'npm ERR! ERESOLVE unable to resolve dependency tree\n' +
    'npm ERR! \n' +
    'npm ERR! While resolving: [email protected]\n' +
    'npm ERR! Found: [email protected]\n' +
    'npm ERR! node_modules/eslint-plugin-import\n' +
    'npm ERR!   dev eslint-plugin-import@"2.25.2" from the root project\n' +
    'npm ERR! \n' +
    'npm ERR! Could not resolve dependency:\n' +
    'npm ERR! peer eslint-plugin-import@"^2.25.3" from [email protected]\n' +
    'npm ERR! node_modules/eslint-config-airbnb-typescript\n' +
    'npm ERR!   dev eslint-config-airbnb-typescript@"*" from the root project\n' +
    'npm ERR! \n' +
    'npm ERR! Fix the upstream dependency conflict, or retry\n' +
    'npm ERR! this command with --force, or --legacy-peer-deps\n' +
    'npm ERR! to accept an incorrect (and potentially broken) dependency resolution.\n' +
    'npm ERR! \n' +
    'npm ERR! See C:\\Users\\Artur\\AppData\\Local\\npm-cache\\eresolve-report.txt for a full report.\n' +
    '\n' +
    'npm ERR! A complete log of this run can be found in:\n' +
    'npm ERR!     C:\\Users\\Artur\\AppData\\Local\\npm-cache\\_logs\\2022-04-16T12_25_21_182Z-debug-0.log',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
\ Installing airbnb...Terminate batch job (Y/N)? y

I have tried to manually rerun the commands with --force without any success.

Regards,
Artur

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.