Code Monkey home page Code Monkey logo

Comments (7)

dsherret avatar dsherret commented on September 23, 2024 3

This will be a bit much though. For example, in some of my projects I wouldn't have time to go through adding examples for everything:

Ensure all symbols have at least one @example tag.

It would be nice to be able to be able to opt-out of certain rules and deno lint provides all that functionality already.

from deno.

dsherret avatar dsherret commented on September 23, 2024 2

I guess being forced to document that isn't so bad now that I think about it more.

from deno.

iuioiua avatar iuioiua commented on September 23, 2024 1

I think it's possible deno doc --lint users will be fine without opt-out. The command is opt-in and likely used by those who want the best for their documentation. It might be worth expanding deno doc --lint until we see sufficient evidence of demand for opt-out, which may never come.

from deno.

iuioiua avatar iuioiua commented on September 23, 2024

I talked with @kt3k; he also thinks this might be a good idea.

from deno.

dsherret avatar dsherret commented on September 23, 2024

I think we might want to consider moving deno doc --lint into the deno lint sub command and only have it active on packages that specify exports. It would be nice to be able to selectively ignore these rules. For example, I don't want to document all these type parameters in deno std:

export function parseArgs<
  TArgs extends Values<
    TBooleans,
    TStrings,
    TCollectable,
    TNegatable,
    TDefaults,
    TAliases
  >,
  TDoubleDash extends boolean | undefined = undefined,
  TBooleans extends BooleanType = undefined,
  TStrings extends StringType = undefined,
  TCollectable extends Collectable = undefined,
  TNegatable extends Negatable = undefined,
  TDefaults extends Record<string, unknown> | undefined = undefined,
  TAliases extends Aliases<TAliasArgNames, TAliasNames> | undefined = undefined,
  TAliasArgNames extends string = string,
  TAliasNames extends string = string,
>(
  args: string[],
  {
    "--": doubleDash = false,
    alias = {} as NonNullable<TAliases>,
    boolean = false,
    default: defaults = {} as TDefaults & Defaults<TBooleans, TStrings>,
    stopEarly = false,
    string = [],
    collect = [],
    negatable = [],
    unknown: unknownFn = (i: string): unknown => i,
  }: ParseOptions<
    TBooleans,
    TStrings,
    TCollectable,
    TNegatable,
    TDefaults,
    TAliases,
    TDoubleDash
  > = {},
): Args<TArgs, TDoubleDash> {

from deno.

iuioiua avatar iuioiua commented on September 23, 2024

Perhaps, running code snippets can be done with deno test --doc and the rest with deno doc --lint.

from deno.

NfNitLoop avatar NfNitLoop commented on September 23, 2024

Ensure all type parameters are documented with a @typeparam or @template tag.
Ensure all parameters are documented with a @param, @arg, or @argument tag.
Ensure all functions and methods are documented with a @returns tag.
Ensure all symbols have at least one @example tag.

I've worked in several codebases that had strict lints like this, and they end up with a lot of useless boilerplate like:

/**
 * Foo the bar according to baz. (Something that makes sense in the problem domain.)
 * 
 * @param foo the foo
 * @param bar the bar
 * @param baz the baz
 * @returns a Value.
 */
function doThing(foo: Foo, bar: Bar, baz: Baz): Value {

👍 for gentle reminders that I forgot to document an exported symbol.
👎 to the above kind of tedium.

Without a way to configure deno doc --lint's ruleset, adding such rules would probably make me just avoid using it altogether.

from deno.

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.