Git Product home page Git Product logo

linemod's Introduction

Linemod

npm version npm downloads js-semistandard-style Follow @voxpelli@mastodon.social

CLI companion for linemod-core, a comment driven line modification tool.

Usage

As npm script

"scripts": {
  "test": "linemod -e new index.js lib/utils.js"
}

Command line

npm install -g linemod

Then run it at on your files that has modifications:

linemod -e new index.js lib/utils.js

If your command line supports globbing, then you can do:

linemod -e new *.js lib/**/*.js

Programmatic use

Use linemod-core directly.

Flags

  • --extension / -erequired – the file extension used on the output files.

Additional command line flags

  • --help / -h – prints all available flags
  • --strict / -s – treats warnings as errors
  • --verbose / -v – prints warnings and notices

Available modifications

All linemod-core modifications are supported. Linemods are added at the end of the line they are supposed to apply to.

linemod-add:

Prefixes the line with whatever is specified after the keyword:

// linemod-add: import escape from 'stringify-entities';

Becomes:

import escape from 'stringify-entities';

linemod-prefix-with:

Prefixes the line with whatever is specified after the keyword:

const exportedMethod = () => {}; // linemod-prefix-with: export

Becomes:

export const exportedMethod = () => {};

linemod-replace-with:

Replaces the line with whatever is specified after the keyword:

const escape = require('stringify-entities'); // linemod-replace-with: import escape from 'stringify-entities';

Becomes:

import escape from 'stringify-entities';

linemod-remove

Simply removes the entire line.

Quite useful when combined with linemod-prefix-with:

const exportedMethod = () => {}; // linemod-prefix-with: export
module.exports = { exportedMethod }; // linemod-remove

Becomes:

export const exportedMethod = () => {};

linemod's People

Contributors

renovate-bot avatar renovate[bot] avatar voxpelli avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

linemod's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/codeql-analysis.yml
.github/workflows/dependency-review.yml
.github/workflows/lint.yml
.github/workflows/nodejs.yml
.github/workflows/types.yml
npm
package.json
  • chalk ^5.2.0
  • linemod-core ^1.1.0
  • meow ^12.0.1
  • @voxpelli/eslint-config ^18.0.0
  • @voxpelli/tsconfig ^8.0.0
  • eslint ^8.42.0
  • eslint-plugin-es-x ^7.1.0
  • eslint-plugin-import ^2.27.5
  • eslint-plugin-jsdoc ^46.2.6
  • eslint-plugin-mocha ^10.1.0
  • eslint-plugin-n ^16.0.0
  • eslint-plugin-promise ^6.1.1
  • eslint-plugin-security ^1.7.1
  • eslint-plugin-sort-destructure-keys ^1.5.0
  • eslint-plugin-unicorn ^47.0.0
  • husky ^8.0.3
  • installed-check ^7.1.1
  • knip ^2.13.0
  • npm-run-all2 ^6.0.5
  • type-coverage ^2.26.0
  • typescript ~5.1.3
  • node >=16.10.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.