GithubHelp home page GithubHelp logo

API about stylelint HOT 15 CLOSED

stylelint avatar stylelint commented on May 22, 2024
API

from stylelint.

Comments (15)

jeddy3 avatar jeddy3 commented on May 22, 2024

So am I right in thinking that, with the addition of result.messages to postcss, stylelint will be a collection of linter postcss plugins, just like cssnext is a collection of transpiler postcss plugins (with added caniuse support)?

And, just like cssnext, you'll be able to pass in a big options parameter. In stylelint's case, configuration options for the rules e.g:

var output = stylelint(input, {
  rules: {
    indentation: {
      default: 1,
      char: "\t",
    },
    eof-newline: true
  } 
})

And, with the addition of result.messages to postcss, stylelint will be able to capture all the messages from the separate linter plugins and display them in a nice way?

If so, that all sounds fantastic to me! :)

from stylelint.

MoOx avatar MoOx commented on May 22, 2024

You are right 😉

from stylelint.

jeddy3 avatar jeddy3 commented on May 22, 2024

Awesome :)

from stylelint.

davidtheclark avatar davidtheclark commented on May 22, 2024

Sounds great to me. Good thinking.

from stylelint.

davidtheclark avatar davidtheclark commented on May 22, 2024

I was thinking about writing some linter modules sometime soonish, and just wanted to ensure that they would be compatible with stylelint once stylelint gets going. So I have one question for @MoOx about the intentions of stylelint: If I write linting modules that register their complaints via the PostCSS 4.1+ warnings API, will that be enough for stylelint to understand and interpret them? Is the plan to build stylelint right on top of that API?

from stylelint.

MoOx avatar MoOx commented on May 22, 2024

FYI this messages API in postcss exists because I gave the idea for stylelint. So yes I would definitly use it :)
I don't plan to make hundreds of postcss-* plugins for this linter and would prefer to get the rules in a single repo.
I really like ESLint so I think I will try to mimic the way you can use it. So we should definitly support "stylelint plugin" (-> postcss plugin).

For a quick start I plan to work on stylelint as a postcss plugin. I will try to work on this really soon.

from stylelint.

magsout avatar magsout commented on May 22, 2024

👍

from stylelint.

lorenz068 avatar lorenz068 commented on May 22, 2024

Is it currently fonctionnal? If i read your source code i don't read anything about CSS. Just JS right?

from stylelint.

MoOx avatar MoOx commented on May 22, 2024

Nothing has been made yet.

from stylelint.

davidtheclark avatar davidtheclark commented on May 22, 2024

Until there is some other structure in place, what would you think of the following temporary setup:

  • Write and test rules individually, as though they were individual plugins although they live here in the same repo; basically, they are functions that accept the AST and result objects and register warnings on the result.
  • The plugin itself accepts a single options object containing settings for all rules.
  • Rules register problems as warnings. These could then be printed in the console by the runner or with something like postcss-log-warnings.

?? Would that work as a temporary setup?

I might have some time to write some rules soon -- e.g. at laundromat tonight :) -- so I wanted to see if there was an acceptable way to get something usable going. I can implement this if you agree with it.

from stylelint.

MoOx avatar MoOx commented on May 22, 2024

That would totally works for me.
Sorry to started something and to not do anything... I am really busy with cssnext these days...
So I added you as a collaborator ;)

from stylelint.

davidtheclark avatar davidtheclark commented on May 22, 2024

Ok. I understand that it's OSS and you do not have unlimited time, so definitely wasn't trying to pressure you :) Just wanted a starting point, and this would work. Cool! Hope I can write a few soon.

from stylelint.

jeddy3 avatar jeddy3 commented on May 22, 2024

Would that work as a temporary setup?

Sounds good to me!

from stylelint.

MoOx avatar MoOx commented on May 22, 2024

I think we can close this one for now. Don't you think ?

from stylelint.

davidtheclark avatar davidtheclark commented on May 22, 2024

Yes.

from stylelint.

Related Issues (20)

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.