Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Oct 23, 2023
1 parent ff79d0d commit 940d9d0
Show file tree
Hide file tree
Showing 14 changed files with 446 additions and 348 deletions.
47 changes: 23 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
module.exports = {
root: true,
ignorePatterns: [
'cli/',
'theme/',
],
ignorePatterns: ['cli/', '.cache/', 'public/'],
extends: [
'@npmcli',
'eslint:recommended',
'plugin:react/recommended',
'plugin:github/react',
Expand All @@ -17,26 +13,29 @@ module.exports = {
version: 'detect',
},
},
overrides: [{
files: ['src/**'],
parserOptions: {
ecmaFeatures: {
jsx: true,
overrides: [
{
files: ['src/**'],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
env: {
commonjs: true,
es2022: true,
browser: true,
node: false,
},
rules: {
'max-len': 'off',
},
},
env: {
commonjs: true,
es2022: true,
browser: true,
node: false,
},
rules: {
'max-len': 'off',
},
}, {
files: ['src/shared.js'],
rules: {
'react/no-unescaped-entities': 'off',
{
files: ['src/shared.js'],
rules: {
'react/no-unescaped-entities': 'off',
},
},
}],
],
}
3 changes: 0 additions & 3 deletions .prettierIgnore
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
**/template-oss/*.json
**/template-oss/*.yml
content/
content-debug/
cli/
.github/
package-lock.json
CODE_OF_CONDUCT.md
CONTENT-MODEL.md
SECURITY.md
25 changes: 12 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ We pledge to act and interact in ways that contribute to an open, welcoming, div

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Contacting individual members, contributors, or leaders privately, outside designated community mechanisms, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Contacting individual members, contributors, or leaders privately, outside designated community mechanisms, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Expand Down Expand Up @@ -65,7 +65,7 @@ Community leaders will follow these Community Impact Guidelines in determining t

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

Expand All @@ -78,4 +78,3 @@ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcem
[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at <https://www.contributor-covenant.org/faq>. Translations are available at <https://www.contributor-covenant.org/translations>.

85 changes: 49 additions & 36 deletions CONTENT-MODEL.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,103 @@
# Content model

## Introduction
This content model explains the goals of content in the npm docs, and what to include when you're writing or updating an article. We use a model to ensure that our content consistently, clearly, and comprehensively communicates what people need to achieve their goals with npm.
Following a content model creates consistency that helps users and maintainers of the docs.

This content model explains the goals of content in the npm docs, and what to include when you're writing or updating an article. We use a model to ensure that our content consistently, clearly, and comprehensively communicates what people need to achieve their goals with npm. Following a content model creates consistency that helps users and maintainers of the docs.

For style questions, default to https://github.com/github/docs-internal/blob/main/contributing/content-style-guide.md

## Content structure

Docs are grouped by topic.
* Top-level doc set (Example: https://docs.npmjs.com/packages-and-modules)
* Categories (Example: https://docs.npmjs.com/packages-and-modules/introduction-to-packages-and-modules)
* Articles (Example: https://docs.npmjs.com/about-packages-and-modules)

- Top-level doc set (Example: https://docs.npmjs.com/packages-and-modules)
- Categories (Example: https://docs.npmjs.com/packages-and-modules/introduction-to-packages-and-modules)
- Articles (Example: https://docs.npmjs.com/about-packages-and-modules)

### Categories

Categories are organized around a feature or a discrete set of tasks. Use titles that are task-based and describe the purpose or goal of the category.

### Articles

Articles are the basic unit of content for the docs. Use titles that are clear, descriptive, and specific, with the same terminology as the product itself. All articles follow the same content order.

#### Content order

Introduce content from the broadest applicability to the most specific, following this order:

* Conceptual content
* Procedural content for enabling a feature or setting
* Procedural content on using a feature
* Procedural content on managing a feature or setting
* Procedural content on disabling a feature or setting
* Procedural content on destructive actions (e.g. deletion)
* Troubleshooting information
- Conceptual content
- Procedural content for enabling a feature or setting
- Procedural content on using a feature
- Procedural content on managing a feature or setting
- Procedural content on disabling a feature or setting
- Procedural content on destructive actions (e.g. deletion)
- Troubleshooting information

Articles answer, “What is it? Why do it?” and then “How does someone do it?”

#### Content types

**Conceptual**

Conceptual content helps people understand a feature or topic by providing a clear, high-level overview, explanation of how the feature or topic can help them on their journey, and context like use cases or examples. Conceptual content is clear enough for a novice audience but also includes relevant information for advanced users. People most often use conceptual content when they're learning.
If people need certain permissions to do a task described in the article, include a permissions statement describing who can do the task in the conceptual information.
Conceptual content helps people understand a feature or topic by providing a clear, high-level overview, explanation of how the feature or topic can help them on their journey, and context like use cases or examples. Conceptual content is clear enough for a novice audience but also includes relevant information for advanced users. People most often use conceptual content when they're learning. If people need certain permissions to do a task described in the article, include a permissions statement describing who can do the task in the conceptual information.

How to write conceptual content
* If people need specific permissions to do what is described in the article, list those required permissions
* Describe in plain language what the feature, setting, or topic is
* Describe its purpose and why it’s useful to the reader
* Share use cases or examples
* If relevant, describe how the feature or topic works
* Highlight any details the reader needs to know to use the feature
* Include next steps for getting started with the feature (whether through further reading links or content within the article itself)

- If people need specific permissions to do what is described in the article, list those required permissions
- Describe in plain language what the feature, setting, or topic is
- Describe its purpose and why it’s useful to the reader
- Share use cases or examples
- If relevant, describe how the feature or topic works
- Highlight any details the reader needs to know to use the feature
- Include next steps for getting started with the feature (whether through further reading links or content within the article itself)

**Procedural**

Procedural content helps people complete a task from start to finish while they're using npm. Procedural content gives context on how the task fits into someone's larger journey. If a procedure has prerequisites, include them before the procedural content.

How to write procedural content
* Group multiple related procedures into a single article unless there's a reason not to
* Use ordered lists for procedural steps
* If a step is optional, indicate that first
* Tell readers the expected outcome of any procedures
* Include troubleshooting tips as frequently as possible

- Group multiple related procedures into a single article unless there's a reason not to
- Use ordered lists for procedural steps
- If a step is optional, indicate that first
- Tell readers the expected outcome of any procedures
- Include troubleshooting tips as frequently as possible

How to write prerequisites
* Put the prerequisites immediately before the procedure that they are relevant to. If the prerequisites are relevant to all the procedures in an article, put them after the conceptual content and before the first procedure
* You can use a list, a sentence, or a paragraph to explain prerequisites
* You can also use a separate prerequisites section when:
* The prerequisite information is very important and should not be missed
* There is more than one prerequisite

- Put the prerequisites immediately before the procedure that they are relevant to. If the prerequisites are relevant to all the procedures in an article, put them after the conceptual content and before the first procedure
- You can use a list, a sentence, or a paragraph to explain prerequisites
- You can also use a separate prerequisites section when:
- The prerequisite information is very important and should not be missed
- There is more than one prerequisite

#### Contents of an article
* Title
* Conceptual content
* Prerequisites (if applicable)
* Procedural content
* Troubleshooting (if applicable)

- Title
- Conceptual content
- Prerequisites (if applicable)
- Procedural content
- Troubleshooting (if applicable)

## User and job stories

When planning content, you can create user and job stories to define acceptance criteria that help determine if an article is helping users accomplish their goals.

### User stories

Create user stories to better understand each audience when a feature affects more than one audience.

As a [person in a particular role], I want to [perform an action or find something out], so that I can [achieve my goal of...].

### Job stories

Job stories are narrow, granular, and useful for targeted actions or specific tasks that a single audience wants to achieve.

When [there's a particular situation], I want to [perform an action or find something out], so that I can [achieve my goal of...].

### Acceptance criteria

Acceptance criteria explain the specific ways we'll know when a user or job story is considered complete. To define acceptance criteria, identify what an article has to offer someone for them to complete their desired task and feel satisfied.

## Article template
Expand Down
Loading

0 comments on commit 940d9d0

Please sign in to comment.