Giter VIP home page Giter VIP logo

babel-plugin-caralho's Introduction

babel-plugin-caralho

Babel plugin for writing curse words instead of important because reasons

Example

The example is in styled-components but it also works with Glamor as seen here and Emotion as seen here because it just looks for strings.

In

import React from 'react';
import styled from 'styled-components';

const Title = styled.h1`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
`;

const Wrapper = styled.section`
  padding: 4em;
  background: papayawhip !fuck;
`;

render(
  <Wrapper>
    <Title>Hello World, this is my styled component!</Title>
  </Wrapper>
);

Out

import React from 'react';
import styled from 'styled-components';

const Title = styled.h1`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
`;

const Wrapper = styled.section`
  padding: 4em;
  background: papayawhip !important;
`;

render(
  <Wrapper>
    <Title>Hello World, this is my styled component!</Title>
  </Wrapper>
);

Installation

$ npm install babel-plugin-caralho --save-dev
or
$ yarn add babel-plugin-caralho --dev

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["caralho"]
}

Via CLI

$ babel --plugins caralho script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["caralho"]
});

Words

Instead of !fuck, you can also choose from many more options in different languages and all of them will become !important after Babel does his/her thing.

I want to add words !

Awesome ! You can create a PR here: https://github.com/SaraVieira/curse-words and these tests and the ones in https://github.com/SaraVieira/postcss-caralho will be generated automatically ๐ŸŽ‰

License

WTFPL โ€“ Do What the Fuck You Want to Public License.

babel-plugin-caralho's People

Contributors

itsjw avatar saravieira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pi0 itsjw

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.