onebeyond / systemic

📦 A minimal dependency injection framework.
https://onebeyond.github.io/systemic
MIT License
56 stars 7 forks source link

Linting messes up the documentation #59

Closed teunmooij closed 2 years ago

teunmooij commented 2 years ago

Examples in documentation look like:

const Systemic = require('systemic');
const Config = require('./components/config');
const Logger = require('./components/logger');
const Mongo = require('./components/mongo');

module.exports = () => Systemic().add('config', Config(), { scoped: true }).add('logger', Logger()).dependsOn('config').add('mongo.primary', Mongo()).dependsOn('config', 'logger').add('mongo.secondary', Mongo()).dependsOn('config', 'logger');

They would be easier to read looking like:

const Systemic = require('systemic');
const Config = require('./components/config');
const Logger = require('./components/logger');
const Mongo = require('./components/mongo');

module.exports = () => Systemic()
  .add('config', Config(), { scoped: true })
  .add('logger', Logger()).dependsOn('config')
  .add('mongo.primary', Mongo()).dependsOn('config', 'logger')
  .add('mongo.secondary', Mongo()).dependsOn('config', 'logger');

But lint-staged configuration doesn't allow that.

cressie176 commented 2 years ago

I think the prettier prose-wrap "preserve" option might fix this

cressie176 commented 2 years ago

Sadly prose-wrap doesnt work on code examples, so I used ignore ranges instead