@inclusive-design/eslint-config 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = tab
5
+ end_of_line = lf
6
+ charset = utf-8
7
+ trim_trailing_whitespace = true
8
+ insert_final_newline = true
9
+
10
+ [*.yml]
11
+ indent_style = space
12
+ indent_size = 2
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Describe the bug
10
+
11
+ A clear and concise description of what the bug is.
12
+
13
+ ## To Reproduce
14
+
15
+ Steps to reproduce the behavior:
16
+
17
+ 1. Go to '...'
18
+ 2. Click on '....'
19
+ 3. Scroll down to '....'
20
+ 4. See error
21
+
22
+ ## Expected behavior
23
+
24
+ A clear and concise description of what you expected to happen.
25
+
26
+ ## Screenshots
27
+
28
+ If applicable, add screenshots to help explain your problem.
29
+
30
+ ## Desktop (please complete the following information):
31
+
32
+ - OS: [e.g. iOS]
33
+ - Browser [e.g. chrome, safari]
34
+ - Version [e.g. 22]
35
+
36
+ ## Smartphone (please complete the following information):
37
+
38
+ - Device: [e.g. iPhone6]
39
+ - OS: [e.g. iOS8.1]
40
+ - Browser [e.g. stock browser, safari]
41
+ - Version [e.g. 22]
42
+
43
+ ## Additional context
44
+
45
+ Add any other context about the problem here.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Is your feature request related to a problem? Please describe.
10
+
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ ## Describe the solution you'd like
14
+
15
+ A clear and concise description of what you want to happen.
16
+
17
+ ## Describe alternatives you've considered
18
+
19
+ A clear and concise description of any alternative solutions or features you've considered.
20
+
21
+ ## Additional context
22
+
23
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,130 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, religion, or sexual identity
11
+ and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the
27
+ overall community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or
32
+ advances of any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email
36
+ address, without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ [idrc@ocadu.ca](mailto:idrc@ocadu.ca).
65
+
66
+ All complaints will be reviewed and investigated promptly and fairly.
67
+
68
+ All community leaders are obligated to respect the privacy and security of the
69
+ reporter of any incident.
70
+
71
+ ## Enforcement Guidelines
72
+
73
+ Community leaders will follow these Community Impact Guidelines in determining
74
+ the consequences for any action they deem in violation of this Code of Conduct:
75
+
76
+ ### 1. Correction
77
+
78
+ **Community Impact**: Use of inappropriate language or other behavior deemed
79
+ unprofessional or unwelcome in the community.
80
+
81
+ **Consequence**: A private, written warning from community leaders, providing
82
+ clarity around the nature of the violation and an explanation of why the
83
+ behavior was inappropriate. A public apology may be requested.
84
+
85
+ ### 2. Warning
86
+
87
+ **Community Impact**: A violation through a single incident or series
88
+ of actions.
89
+
90
+ **Consequence**: A warning with consequences for continued behavior. No
91
+ interaction with the people involved, including unsolicited interaction with
92
+ those enforcing the Code of Conduct, for a specified period of time. This
93
+ includes avoiding interactions in community spaces as well as external channels
94
+ like social media. Violating these terms may lead to a temporary or
95
+ permanent ban.
96
+
97
+ ### 3. Temporary Ban
98
+
99
+ **Community Impact**: A serious violation of community standards, including
100
+ sustained inappropriate behavior.
101
+
102
+ **Consequence**: A temporary ban from any sort of interaction or public
103
+ communication with the community for a specified period of time. No public or
104
+ private interaction with the people involved, including unsolicited interaction
105
+ with those enforcing the Code of Conduct, is allowed during this period.
106
+ Violating these terms may lead to a permanent ban.
107
+
108
+ ### 4. Permanent Ban
109
+
110
+ **Community Impact**: Demonstrating a pattern of violation of community
111
+ standards, including sustained inappropriate behavior, harassment of an
112
+ individual, or aggression toward or disparagement of classes of individuals.
113
+
114
+ **Consequence**: A permanent ban from any sort of public interaction within
115
+ the community.
116
+
117
+ ## Attribution
118
+
119
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
120
+ version 2.0, available at
121
+ [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
122
+
123
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
124
+ enforcement ladder](https://github.com/mozilla/diversity).
125
+
126
+ [homepage]: https://www.contributor-covenant.org
127
+
128
+ For answers to common questions about this code of conduct, see the FAQ at
129
+ [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at
130
+ [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
@@ -0,0 +1,25 @@
1
+ <!-- markdownlint-disable MD041 -->
2
+
3
+ * [ ] This pull request has been tested by running `npm run test` without errors
4
+ * [ ] This pull request has been built by running `npm run build` without errors
5
+ * [ ] This isn't a duplicate of an existing pull request
6
+
7
+ ## Description
8
+
9
+ <!-- Description of the pull request -->
10
+
11
+ ## Steps to test
12
+
13
+ 1. <!-- First step -->
14
+ 2. <!-- Second step -->
15
+ 3. <!-- and so on... -->
16
+
17
+ **Expected behavior:** <!-- What should happen -->
18
+
19
+ ## Additional information
20
+
21
+ <!-- Please provide any additional information that can help us review your contribution. -->
22
+
23
+ ## Related issues
24
+
25
+ <!-- If this pull request resolves an issue, please indicate the issue number here, e.g. 'Resolves #42' -->
@@ -0,0 +1,11 @@
1
+ name: Lint and test
2
+
3
+ on:
4
+ push:
5
+ branches: [dev, main]
6
+ pull_request:
7
+ branches: [dev, main]
8
+
9
+ jobs:
10
+ lint-and-test:
11
+ uses: inclusive-design/workflows/.github/workflows/node-lint-and-test.yml@main
@@ -0,0 +1,89 @@
1
+ name: Merge release
2
+
3
+ on:
4
+ release:
5
+ types: [released]
6
+ workflow_dispatch:
7
+ inputs:
8
+ branch:
9
+ description: "Branch to merge into"
10
+ required: false
11
+ type: string
12
+ default: main
13
+ tag:
14
+ description: "Tag to merge"
15
+ required: true
16
+ type: string
17
+
18
+ jobs:
19
+ merge-release:
20
+ timeout-minutes: 5
21
+ permissions:
22
+ contents: write
23
+ strategy:
24
+ fail-fast: true
25
+ matrix:
26
+ os: ["ubuntu-latest"]
27
+ runs-on: ${{ matrix.os }}
28
+
29
+ name: Merge tag
30
+
31
+ steps:
32
+ - uses: actions/create-github-app-token@v2
33
+ id: app-token
34
+ with:
35
+ app-id: ${{ vars.GHA_APP_ID }}
36
+ private-key: ${{ secrets.GHA_PRIVATE_KEY }}
37
+
38
+ - name: Determine branch
39
+ run: |
40
+ echo 'BRANCH='${{ inputs.branch || 'main' }} >> $GITHUB_ENV
41
+
42
+ - name: Checkout "${{ env.BRANCH }}" branch locally
43
+ uses: actions/checkout@v5
44
+ with:
45
+ ref: ${{ env.BRANCH }}
46
+ fetch-tags: true
47
+ fetch-depth: 0
48
+ token: ${{ steps.app-token.outputs.token }}
49
+
50
+ - name: Get GitHub App User ID
51
+ if: ${{ github.event_name == 'release' }}
52
+ id: get-user-id
53
+ run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
54
+ env:
55
+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
56
+
57
+ - name: Update values for git user config (release)
58
+ if: ${{ github.event_name == 'release' }}
59
+ run: |
60
+ echo "GIT_USER_NAME=${{ steps.app-token.outputs.app-slug }}[bot]" >> $GITHUB_ENV
61
+ echo "GIT_USER_EMAIL=${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com" >> $GITHUB_ENV
62
+
63
+ - name: Update values for git user config (workflow_dispatch)
64
+ if: ${{ github.event_name == 'workflow_dispatch' }}
65
+ run: |
66
+ # fetch user info
67
+ user=$(gh api \
68
+ -H "Accept: application/vnd.github+json" \
69
+ -H "X-GitHub-Api-Version: 2022-11-28" \
70
+ /user/$ACCOUNT_ID )
71
+
72
+ # get user's name and email
73
+ # email will be set to null if it is private
74
+ name=$(echo $user | jq '.name')
75
+ email=$(echo $user | jq '.email')
76
+
77
+ # store in environment variables to use for setting up git user
78
+ echo "GIT_USER_NAME=$name" >> $GITHUB_ENV
79
+ echo "GIT_USER_EMAIL=$email" >> $GITHUB_ENV
80
+ env:
81
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82
+ ACCOUNT_ID: ${{ github.actor_id }}
83
+
84
+ - name: Merge tag to "${{ env.BRANCH }}" branch
85
+ run: |
86
+ git config --local user.email "$GIT_USER_EMAIL"
87
+ git config --local user.name "$GIT_USER_NAME"
88
+ git merge ${{ inputs.tag || github.event.release.tag_name }}
89
+ git push
@@ -0,0 +1,17 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [dev]
6
+
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ release:
13
+ uses: inclusive-design/workflows/.github/workflows/release-please.yml@main
14
+ with:
15
+ GHA_APP_ID: ${{ vars.GHA_APP_ID }}
16
+ secrets:
17
+ GHA_PRIVATE_KEY: ${{ secrets.GHA_PRIVATE_KEY }}
@@ -0,0 +1,10 @@
1
+ name: Sync branches
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ sync-branches:
9
+ uses: inclusive-design/workflows/.github/workflows/sync-branches.yml@main
10
+ secrets: inherit
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0"
3
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "languages": {
3
+ "JavaScript": {
4
+ "formatter": [],
5
+ "code_actions_on_format": {
6
+ "source.fixAll.eslint": true
7
+ }
8
+ }
9
+ }
10
+ }
@@ -0,0 +1 @@
1
+ export {default} from './index.js';
package/index.js ADDED
@@ -0,0 +1,10 @@
1
+ import {defineConfig} from 'eslint/config';
2
+ import xoBrowser from 'eslint-config-xo/browser';
3
+ import eslintPluginUnicorn from 'eslint-plugin-unicorn';
4
+
5
+ export default defineConfig([
6
+ {
7
+ extends: [xoBrowser, eslintPluginUnicorn.configs.recommended],
8
+ files: ['**/*.js'],
9
+ },
10
+ ]);
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@inclusive-design/eslint-config",
3
+ "version": "0.1.0",
4
+ "description": "Shareable ESLint configuration for the Inclusive Design Research Centre.",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "lint": "eslint",
9
+ "test": "node --test"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/inclusive-design/eslint-config.git"
14
+ },
15
+ "keywords": [
16
+ "eslint"
17
+ ],
18
+ "author": {
19
+ "name": "OCAD University",
20
+ "email": "idrc@ocadu.ca"
21
+ },
22
+ "license": "BSD-3-Clause",
23
+ "bugs": {
24
+ "url": "https://github.com/inclusive-design/eslint-config/issues"
25
+ },
26
+ "homepage": "https://github.com/inclusive-design/eslint-config#readme",
27
+ "dependencies": {
28
+ "eslint": "^9.0.0",
29
+ "eslint-config-xo": "^0.49.0",
30
+ "eslint-plugin-unicorn": "^62.0.0"
31
+ }
32
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3
+ "release-type": "node",
4
+ "include-component-in-tag": false,
5
+ "pull-request-title-pattern": "chore(release): release ${version}",
6
+ "packages": {
7
+ ".": {
8
+ "package-name": "@inclusive-design/eslint-config"
9
+ }
10
+ }
11
+ }
package/renovate.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended"
5
+ ],
6
+ "lockFileMaintenance": {
7
+ "enabled": true,
8
+ "automerge": true
9
+ },
10
+ "labels": [
11
+ "dependencies"
12
+ ],
13
+ "packageRules": [
14
+ {
15
+ "matchUpdateTypes": [
16
+ "minor",
17
+ "patch"
18
+ ],
19
+ "matchCurrentVersion": "!/^0/",
20
+ "automerge": true
21
+ }
22
+ ]
23
+ }