@singlepixellab/eslint-config 1.0.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,11 @@
1
+ # https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ tab_width = 2
8
+ end_of_line = lf
9
+ charset = utf-8
10
+ trim_trailing_whitespace = true
11
+ insert_final_newline = true
package/.eslintrc ADDED
@@ -0,0 +1,3 @@
1
+ // This empty file is added because of an issue with eslint-plugin-import,
2
+ // remove it when the below issue is fixed
3
+ // https://github.com/import-js/eslint-plugin-import/issues/3079
@@ -0,0 +1,21 @@
1
+ name: Publish Package to npmjs
2
+ on:
3
+ release:
4
+ types: [published]
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ # Setup .npmrc file to publish to npm
14
+ - uses: actions/setup-node@v4
15
+ with:
16
+ node-version: '20.x'
17
+ registry-url: 'https://registry.npmjs.org'
18
+ - run: npm ci
19
+ - run: npm publish --provenance --access public
20
+ env:
21
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,7 @@
1
+ {
2
+ "recommendations": [
3
+ "EditorConfig.EditorConfig",
4
+ "esbenp.prettier-vscode",
5
+ "dbaeumer.vscode-eslint"
6
+ ]
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "search.exclude": {
3
+ "**/package-lock.json": true
4
+ },
5
+ "editor.codeActionsOnSave": {
6
+ "source.fixAll.eslint": "explicit"
7
+ }
8
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Single Pixel Lab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # @singlepixellab/eslint-config
2
+
3
+ The ESLint rules and configs used by Single Pixel Lab.
4
+
5
+ ## Usage
6
+
7
+ 1. Install package
8
+ ```
9
+ npm install -dev @singlepixellab/eslint-config
10
+ ```
11
+
12
+ ## VS Code
13
+
14
+ - Install [ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) for VS Code: `dbaeumer.vscode-eslint`
15
+ - To run ESLint fix command (i.e. eslint --fix) whenever a file is saved, add the following config in the `settings.json` file:
16
+ ```
17
+ {
18
+ "editor.codeActionsOnSave": {
19
+ "source.fixAll.eslint": "explicit"
20
+ },
21
+ }
22
+ ```
@@ -0,0 +1,30 @@
1
+ import ignores from "./rules/ignores.js";
2
+ import core from "./rules/core.js";
3
+ import imports from "./rules/imports.js";
4
+ import react from "./rules/react.js";
5
+ import prettier from "./rules/prettier.js";
6
+ import jsdoc from "./rules/jsdoc.js";
7
+ import styles from "./rules/styles.js";
8
+
9
+ /** @type {import('eslint').Linter.Config[]} */
10
+ export default [
11
+ // Global ignores should always be first
12
+ ...ignores,
13
+
14
+ ...core,
15
+
16
+ // styles: @stylistic/eslint-plugin
17
+ ...styles,
18
+
19
+ // eslint-plugin-import
20
+ ...imports,
21
+
22
+ // eslint-plugin-jsdoc
23
+ ...jsdoc,
24
+
25
+ // eslint-plugin-react, eslint-plugin-react-hooks etc
26
+ ...react,
27
+
28
+ // Prettier should be last to have the opportunity to override other configs
29
+ ...prettier,
30
+ ];
package/index.js ADDED
@@ -0,0 +1,20 @@
1
+ import config from "./eslint.config";
2
+ import core from "./rules/core.js";
3
+ import ignores from "./rules/ignores.js";
4
+ import imports from "./rules/imports.js";
5
+ import jsdoc from "./rules/jsdoc.js";
6
+ import prettier from "./rules/prettier.js";
7
+ import react from "./rules/react.js";
8
+ import styles from "./rules/styles.js";
9
+
10
+ export default config;
11
+
12
+ export const configs = {
13
+ core,
14
+ ignores,
15
+ imports,
16
+ jsdoc,
17
+ prettier,
18
+ react,
19
+ styles,
20
+ };
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@singlepixellab/eslint-config",
3
+ "version": "1.0.0",
4
+ "description": "The ESLint rules and configs used by Single Pixel Lab",
5
+ "author": "Single Pixel Lab",
6
+ "keywords": [
7
+ "eslint",
8
+ "eslintconfig",
9
+ "eslint-config",
10
+ "lint"
11
+ ],
12
+ "license": "MIT",
13
+ "private": false,
14
+ "homepage": "https://github.com/singlepixellab/eslint-config#readme",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/singlepixellab/eslint-config.git"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/singlepixellab/eslint-config/issues"
21
+ },
22
+ "main": "index.js",
23
+ "type": "module",
24
+ "prettier": "@singlepixellab/prettier-config",
25
+ "peerDependencies": {
26
+ "eslint": ">= 9"
27
+ },
28
+ "scripts": {
29
+ "format": "prettier --cache --write .",
30
+ "format:check": "prettier --cache --check .",
31
+ "lint": "eslint .",
32
+ "inspect": "eslint --inspect-config"
33
+ },
34
+ "devDependencies": {
35
+ "@eslint/js": "^9.32.0",
36
+ "@singlepixellab/prettier-config": "^1.0.0",
37
+ "@stylistic/eslint-plugin": "^5.2.2",
38
+ "eslint": "^9.32.0",
39
+ "eslint-config-prettier": "^10.1.8",
40
+ "eslint-plugin-import": "^2.32.0",
41
+ "eslint-plugin-jsdoc": "^51.4.1",
42
+ "eslint-plugin-jsx-a11y": "^6.10.2",
43
+ "eslint-plugin-prettier": "^5.5.3",
44
+ "eslint-plugin-react": "^7.37.2",
45
+ "eslint-plugin-react-hooks": "^5.2.0",
46
+ "globals": "^16.3.0",
47
+ "prettier": "^3.6.2"
48
+ }
49
+ }