@radham/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/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ Changelog
2
+ =========
3
+
4
+ All notable changes to this project will be documented in this file.
5
+
6
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ [1.0.0] - 2025-08-22
10
+ --------------------
11
+
12
+ ### Added
13
+
14
+ - Initial release.
15
+
16
+ [1.0.0]: https://github.com/jbenner-radham/eslint-config/releases/tag/v1.0.0
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, James Benner
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ @radham/eslint-config
2
+ =====================
3
+
4
+ A shareable [ESLint](https://eslint.org/) config with [Stylistic](https://eslint.style/).
5
+
6
+ Install
7
+ -------
8
+
9
+ ```shell
10
+ npm install --save-dev @radham/eslint-config @eslint/js @stylistic/eslint-plugin eslint-plugin-sort typescript-eslint
11
+ ```
12
+
13
+ Usage
14
+ -----
15
+
16
+ ```javascript
17
+ import { defineConfig } from 'eslint/config';
18
+ import radham from '@radham/eslint-config';
19
+
20
+ export default defineConfig([
21
+ {
22
+ files: ['**/*.ts'],
23
+ extends: [radham]
24
+ }
25
+ ]);
26
+ ```
27
+
28
+ License
29
+ -------
30
+
31
+ The BSD 3-Clause License (Revised). See the [license file](LICENSE) for details.
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@radham/eslint-config",
3
+ "version": "1.0.0",
4
+ "description": "A shareable ESLint config with Stylistic.",
5
+ "keywords": [
6
+ "eslint",
7
+ "shareable",
8
+ "config",
9
+ "stylistic",
10
+ "typescript"
11
+ ],
12
+ "license": "BSD-3-Clause",
13
+ "author": "James Benner <hello@jamesbenner.com> (https://www.jamesbenner.com/)",
14
+ "type": "module",
15
+ "main": "src/index.js",
16
+ "files": [
17
+ "src",
18
+ "CHANGELOG.md"
19
+ ],
20
+ "devDependencies": {
21
+ "@eslint/js": "^9.34.0",
22
+ "@stylistic/eslint-plugin": "^5.2.3",
23
+ "eslint": "^9.34.0",
24
+ "eslint-plugin-sort": "^4.0.0",
25
+ "np": "^10.2.0",
26
+ "prettier": "^3.6.2",
27
+ "typescript-eslint": "^8.40.0"
28
+ },
29
+ "peerDependencies": {
30
+ "@eslint/js": ">=9",
31
+ "@stylistic/eslint-plugin": ">=5",
32
+ "eslint": ">=9",
33
+ "eslint-plugin-sort": ">=4",
34
+ "typescript-eslint": ">=8"
35
+ },
36
+ "scripts": {
37
+ "np": "np --no-2fa --no-tests",
38
+ "test": "echo \"Error: no test specified\" && exit 1"
39
+ }
40
+ }
package/src/index.js ADDED
@@ -0,0 +1,110 @@
1
+ import js from '@eslint/js';
2
+ import sort from 'eslint-plugin-sort';
3
+ import stylistic from '@stylistic/eslint-plugin';
4
+ import tsEslint from 'typescript-eslint';
5
+
6
+ /** @type {import('eslint').Linter.Config[]} */
7
+ const config = [
8
+ js.configs.recommended,
9
+ sort.configs['flat/recommended'],
10
+ ...tsEslint.configs.recommended,
11
+ {
12
+ plugins: {
13
+ '@stylistic': stylistic
14
+ },
15
+ rules: {
16
+ '@stylistic/arrow-parens': ['error', 'as-needed'],
17
+ '@stylistic/arrow-spacing': ['error', { before: true, after: true }],
18
+ '@stylistic/block-spacing': ['error', 'always'],
19
+ '@stylistic/comma-dangle': ['error', 'never'],
20
+ '@stylistic/comma-spacing': ['error', { before: false, after: true }],
21
+ '@stylistic/computed-property-spacing': ['error', 'never'],
22
+ '@stylistic/dot-location': ['error', 'property'],
23
+ '@stylistic/eol-last': ['error', 'always'],
24
+ '@stylistic/indent': ['error', 2],
25
+ '@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true, mode: 'strict' }],
26
+ '@stylistic/keyword-spacing': ['error', { before: true, after: true }],
27
+ '@stylistic/linebreak-style': ['error', 'unix'],
28
+ '@stylistic/lines-around-comment': [
29
+ 'error',
30
+ { beforeBlockComment: true, beforeLineComment: true, allowBlockStart: true }
31
+ ],
32
+ '@stylistic/lines-between-class-members': ['error', 'always'],
33
+ '@stylistic/max-len': ['error', { code: 100, comments: 100, ignoreUrls: true }],
34
+ '@stylistic/max-statements-per-line': ['error', { max: 1 }],
35
+ '@stylistic/member-delimiter-style': 'error',
36
+ '@stylistic/multiline-ternary': ['error', 'always-multiline'],
37
+ '@stylistic/new-parens': ['error', 'always'],
38
+ '@stylistic/newline-per-chained-call': ['error', { ignoreChainWithDepth: 2 }],
39
+ '@stylistic/no-extra-semi': 'error',
40
+ '@stylistic/no-floating-decimal': 'error',
41
+ '@stylistic/no-mixed-operators': 'error',
42
+ '@stylistic/no-mixed-spaces-and-tabs': 'error',
43
+ '@stylistic/no-multi-spaces': 'error',
44
+ '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0 }],
45
+ '@stylistic/no-tabs': ['error', { allowIndentationTabs: false }],
46
+ '@stylistic/no-trailing-spaces': 'error',
47
+ '@stylistic/no-whitespace-before-property': 'error',
48
+ '@stylistic/object-curly-spacing': ['error', 'always'],
49
+ '@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
50
+ '@stylistic/operator-linebreak': [
51
+ 'error',
52
+ 'after',
53
+ {
54
+ overrides: {
55
+ '?': 'before',
56
+ ':': 'before'
57
+ }
58
+ }
59
+ ],
60
+ '@stylistic/padded-blocks': ['error', 'never'],
61
+ '@stylistic/padding-line-between-statements': [
62
+ 'error',
63
+ { blankLine: 'always', prev: '*', next: 'return' }
64
+ ],
65
+ '@stylistic/quote-props': ['error', 'as-needed'],
66
+ '@stylistic/quotes': ['error', 'single', { allowTemplateLiterals: true }],
67
+ '@stylistic/semi': ['error', 'always'],
68
+ '@stylistic/semi-spacing': 'error',
69
+ '@stylistic/semi-style': ['error', 'last'],
70
+ '@stylistic/space-before-blocks': [
71
+ 'error',
72
+ { classes: 'always', functions: 'always', keywords: 'always' }
73
+ ],
74
+ '@stylistic/space-before-function-paren': [
75
+ 'error',
76
+ { anonymous: 'always', asyncArrow: 'always', named: 'never' }
77
+ ],
78
+ '@stylistic/space-in-parens': ['error', 'never'],
79
+ '@stylistic/space-infix-ops': ['error', { int32Hint: false }],
80
+ '@stylistic/space-unary-ops': ['error', { nonwords: false, words: true }],
81
+ '@stylistic/spaced-comment': ['error', 'always'],
82
+ '@stylistic/switch-colon-spacing': ['error', { before: false, after: true }],
83
+ '@stylistic/template-curly-spacing': ['error', 'never'],
84
+ '@stylistic/template-tag-spacing': ['error', 'never'],
85
+ '@stylistic/type-annotation-spacing': 'error',
86
+ '@stylistic/type-generic-spacing': 'error',
87
+ '@stylistic/type-named-tuple-spacing': 'error',
88
+ '@stylistic/wrap-iife': ['error', 'inside'],
89
+ '@typescript-eslint/no-unused-vars': ['error', { caughtErrorsIgnorePattern: '^_$' }],
90
+ 'sort/destructuring-properties': 'off',
91
+ 'sort/exports': [
92
+ 'error',
93
+ { groups: [], typeOrder: 'preserve', caseSensitive: false, natural: true }
94
+ ],
95
+ 'sort/export-members': ['error', { caseSensitive: false, natural: true }],
96
+ 'sort/imports': [
97
+ 'error',
98
+ { groups: [], separator: '', typeOrder: 'preserve', caseSensitive: false, natural: true }
99
+ ],
100
+ 'sort/import-members': ['error', { caseSensitive: false, natural: true }],
101
+ 'sort/object-properties': 'off',
102
+ camelcase: 'error',
103
+ eqeqeq: ['error', 'smart'],
104
+ 'no-var': 'error',
105
+ 'prefer-const': ['error', { destructuring: 'any', ignoreReadBeforeAssign: false }]
106
+ }
107
+ }
108
+ ];
109
+
110
+ export default config;