generated from kurone-kito/yarn-project-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint,root): added the solid-js configuration
- Loading branch information
1 parent
a09ea33
commit 776133f
Showing
9 changed files
with
283 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# `@kurone-kito/eslint-config-solid` | ||
|
||
My ESLint configuration for Solid.js projects. | ||
|
||
## Usage | ||
|
||
First, install this package and its peer dependencies: | ||
|
||
```sh | ||
npm install --save-dev @kurone-kito/eslint-config-solid eslint | ||
``` | ||
|
||
Then, create a `eslint.config.mjs` file. | ||
If exists, merge the following configuration into it: | ||
|
||
```js | ||
export { default } from '@kurone-kito/eslint-config-solid'; | ||
``` | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"name": "@kurone-kito/eslint-config-solid", | ||
"version": "0.16.1", | ||
"description": "My ESLint configuration for Solid.js projects", | ||
"keywords": [ | ||
"config", | ||
"eslint", | ||
"eslintconfig", | ||
"eslintrc", | ||
"solid-js" | ||
], | ||
"homepage": "https://github.com/kurone-kito/lints-config#readme", | ||
"bugs": "https://github.com/kurone-kito/lints-config/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/kurone-kito/lints-config.git", | ||
"directory": "packages/eslint-config-solid" | ||
}, | ||
"license": "MIT", | ||
"author": "kurone-kito <krone@kit.black> (https://kit.black/)", | ||
"type": "module", | ||
"main": "./dist/index.mjs", | ||
"types": "./dist/index.d.mts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "conc \"yarn:build:*\"", | ||
"build:license": "cpy --flat ../../LICENSE .", | ||
"build:ts": "tsc", | ||
"clean": "rimraf -g \"*.tgz\" \"*.tsbuildinfo\" dist LICENSE", | ||
"prepack": "conc -m 1 \"yarn:clean\" \"yarn:build\"", | ||
"start": "tsc --watch" | ||
}, | ||
"dependencies": { | ||
"@cspell/eslint-plugin": "^8.15.7", | ||
"@eslint/eslintrc": "^3.1.0", | ||
"@eslint/js": "^9.14.0", | ||
"@kurone-kito/eslint-config-base": "workspace:^", | ||
"@typescript-eslint/eslint-plugin": "^8.13.0", | ||
"@typescript-eslint/parser": "^8.13.0", | ||
"eslint-config-stylelint": "^23.0.0", | ||
"eslint-plugin-import": "^2.31.0", | ||
"eslint-plugin-solid": "^0.14.3", | ||
"eslint-plugin-storybook": "^0.11.0", | ||
"eslint-plugin-tailwindcss": "^3.17.5", | ||
"typescript-eslint": "^8.13.0" | ||
}, | ||
"devDependencies": { | ||
"@kurone-kito/typescript-config": "workspace:^", | ||
"@types/eslint": "^9.6.1", | ||
"@types/eslint-plugin-tailwindcss": "^3.17.0", | ||
"@types/eslint__eslintrc": "^2.1.2", | ||
"@types/eslint__js": "^8.42.3", | ||
"@types/node": "^22.9.0", | ||
"@typescript-eslint/utils": "^8.13.0", | ||
"concurrently": "^9.1.0", | ||
"cpy-cli": "^5.0.0", | ||
"eslint": "^9.14.0", | ||
"rimraf": "^5.0.10", | ||
"typescript": "~5.6.3" | ||
}, | ||
"peerDependencies": { | ||
"eslint": ">=9.x.x" | ||
}, | ||
"peerDependenciesMeta": { | ||
"eslint": { | ||
"optional": true | ||
} | ||
}, | ||
"engines": { | ||
"node": "^18.20 || ^20.10 || >=22" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import baseConfig from '@kurone-kito/eslint-config-base'; | ||
import type { TSESLint } from '@typescript-eslint/utils'; | ||
import solid from 'eslint-plugin-solid/configs/typescript'; | ||
import tailwind from 'eslint-plugin-tailwindcss'; | ||
import tsEslint from 'typescript-eslint'; | ||
import { storybookConfig } from './storybook.mjs'; | ||
import { compat } from './utils.mjs'; | ||
|
||
/** | ||
* The ESLint configuration for the base rules. | ||
* | ||
* @see {@link https://github.com/microsoft/TypeScript/issues/47663} | ||
*/ | ||
const config: TSESLint.FlatConfig.ConfigArray = tsEslint.config( | ||
...([ | ||
...baseConfig, | ||
solid, | ||
...storybookConfig, | ||
...tailwind.configs['flat/recommended'], | ||
...compat.extends('eslint-config-stylelint'), | ||
{ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } }, | ||
] as tsEslint.ConfigWithExtends[]), | ||
); | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { Linter } from 'eslint'; | ||
|
||
/** The configuration for ESLint to Storybook */ | ||
export const storybookConfig: readonly Linter.Config[] = [ | ||
{ | ||
files: ['**/*.stories.?([cm])[jt]s?(x)'], | ||
rules: { | ||
/** | ||
* Unconditionally allow export to `default`. | ||
* | ||
* The default is unknown, but since Storybook component definitions | ||
* are structurally dependent on export to `default`, this permission | ||
* is explicitly stated to prevent influence by later configuration | ||
* updates. | ||
*/ | ||
'import/no-anonymous-default-export': 'off', | ||
/** | ||
* Exporting code that depends `on devDependencies is` allowed only | ||
* for specific packages on an exception basis, and it is prohibited | ||
* by default. | ||
* | ||
* To organize dependencies, only packages that directly depend on | ||
* the product code should be listed in the dependencies list, so | ||
* Storybook component definitions not included in the product code | ||
* are exceptionally allowed to rely on `devDependencies`. | ||
*/ | ||
'n/no-unpublished-import': [ | ||
'error', | ||
{ allowModules: ['@storybook/testing-library'] }, | ||
], | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { dirname } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import eslint from '@eslint/js'; | ||
|
||
/** The directory of the current file. */ | ||
export const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
||
/** The compatibility layer for ESLint configuration. */ | ||
export const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: eslint.configs.recommended, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": ["ESNext"], | ||
"outDir": "dist", | ||
"rootDir": "src", | ||
"skipLibCheck": true, | ||
"types": ["node"] | ||
}, | ||
"extends": "@kurone-kito/typescript-config/tsconfig.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters