GithubHelp home page GithubHelp logo

About project structure about stylelint HOT 4 CLOSED

stylelint avatar stylelint commented on May 22, 2024
About project structure

from stylelint.

Comments (4)

MoOx avatar MoOx commented on May 22, 2024

__tests__ is a common pattern used by big projects like react. It avoid to get a huge test folder with duplicated tree structure and ensure modularity of the components. Like having multiples .md files near the corresponding code.

For the index.js we might be able to get rid of it using some others tricks that this kind of exports.
I will think about it.

from stylelint.

tunnckoCore avatar tunnckoCore commented on May 22, 2024

duplicated tree structure and ensure modularity of the components

omg. now tree structure is duplicated and confusing, lol
its enough to have just one test/ folder and in her to have fixtures/ or something..

from stylelint.

MoOx avatar MoOx commented on May 22, 2024
src/rules/*.js
test/rules/*.js
docs/rules/*.js

vs

src/rules/*/*.js
src/rules/*/*.md
src/rules/*/__tests__/*.js

To write decoupled code it make more sense to me.

omg. now tree structure is duplicated and confusing, lol

I work with a lot of people in different teams that like this way that encourage modularity.

Sometimes __tests__ is test but it doesn't change the way files are arranged.
The most I work with fixtures, the more I like to write tiny decoupled components that have fixtures embed in the tests. Like here stylelint already does and eslint does too.
An good example of painful fixtures to maintain is my cssnext project (btw I will change that soon).
es6 template string (multilines string) might help too to have embed fixtures.

from stylelint.

davidtheclark avatar davidtheclark commented on May 22, 2024

I also think that having tests right there next to the thing they're testing makes sense for this project, which will end up having so many relatively independent little parts.

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.