Skip to content

Commit

Permalink
fix/issue 98/scss at rule (#99)
Browse files Browse the repository at this point in the history
* fix: scss preset

* chore: format code

* chore: changeset
  • Loading branch information
sushichan044 authored May 17, 2024
1 parent 914bc47 commit c46191b
Show file tree
Hide file tree
Showing 46 changed files with 165 additions and 185 deletions.
5 changes: 5 additions & 0 deletions .changeset/late-days-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@virtual-live-lab/stylelint-config": patch
---

fix at rule for scss
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# How to contribute

## Did you find a bug?
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# @virtual-live-lab/js-config

このリポジトリは、バーチャルライブ研究会(VLL)内で利用されるJavaScript / TypeScript関連のツールチェインの設定を統一するためのライブラリリポジトリです。
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
//@ts-check
export { default } from "@virtual-live-lab/eslint-config/presets/ts"
export { default } from "@virtual-live-lab/eslint-config/presets/ts";
33 changes: 13 additions & 20 deletions packages/eslint-config/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# @virtual-live-lab/eslint-config

![NPM Version](https://img.shields.io/npm/v/%40virtual-live-lab%2Feslint-config)
Expand Down Expand Up @@ -40,7 +39,7 @@ This package has some presets to zero-config use.

```js
// eslint.config.mjs
export { default } from "@virtual-live-lab/eslint-config/presets/js"
export { default } from "@virtual-live-lab/eslint-config/presets/js";
```

### TypeScript Preset
Expand All @@ -49,7 +48,7 @@ Extends `js` preset.

```js
// eslint.config.mjs
export { default } from "@virtual-live-lab/eslint-config/presets/ts"
export { default } from "@virtual-live-lab/eslint-config/presets/ts";
```

### React Preset
Expand All @@ -58,7 +57,7 @@ Extends `ts` preset.

```js
// eslint.config.mjs
export { default } from "@virtual-live-lab/eslint-config/presets/react"
export { default } from "@virtual-live-lab/eslint-config/presets/react";
```

### Next.js Preset
Expand All @@ -74,7 +73,7 @@ Extends `ts` and `react` preset.
```js
// eslint.config.mjs
export { default } from "@virtual-live-lab/eslint-config/presets/nextjs"
export { default } from "@virtual-live-lab/eslint-config/presets/nextjs";
```

### Astro Preset
Expand All @@ -83,7 +82,7 @@ Extends `ts` and `react` presets.

```js
// eslint.config.mjs
export { default } from "@virtual-live-lab/eslint-config/presets/astro"
export { default } from "@virtual-live-lab/eslint-config/presets/astro";
```

## Addons
Expand All @@ -94,30 +93,24 @@ This package has some addon configurations.

```js
// eslint.config.mjs
import jsxA11y from "@virtual-live-lab/eslint-config/addons/jsxA11y"
import ts from "@virtual-live-lab/eslint-config/presets/ts"
import jsxA11y from "@virtual-live-lab/eslint-config/addons/jsxA11y";
import ts from "@virtual-live-lab/eslint-config/presets/ts";

import tseslint from "typescript-eslint"
import tseslint from "typescript-eslint";

export default tseslint.config(
...ts,
...jsxA11y
)
export default tseslint.config(...ts, ...jsxA11y);
```

### Tailwind CSS

```js
// eslint.config.mjs
import tailwind from "@virtual-live-lab/eslint-config/addons/tailwind"
import ts from "@virtual-live-lab/eslint-config/presets/ts"
import tailwind from "@virtual-live-lab/eslint-config/addons/tailwind";
import ts from "@virtual-live-lab/eslint-config/presets/ts";

import tseslint from "typescript-eslint"
import tseslint from "typescript-eslint";

export default tseslint.config(
...ts,
...tailwind
)
export default tseslint.config(...ts, ...tailwind);
```

## License
Expand Down
10 changes: 2 additions & 8 deletions packages/eslint-config/docs/flat-config.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Flat Configについて

Flat Configは、ESLint v9でデフォルトになった新しいESLintの設定ファイルの形式です。
Expand Down Expand Up @@ -47,10 +46,7 @@ import js from "@virtual-live-lab/eslint-config/presets/js";
import hogehoge from "eslint-config-hogehoge";

/* @type {import("eslint").Linter.FlatConfig[]} */
export default [
...js,
...hoehoge.configs.recommended
];
export default [...js, ...hoehoge.configs.recommended];
```

</details>
Expand All @@ -62,9 +58,7 @@ export default [
```js
import { compat } from "@virtual-live-lab/eslint-config";

export default [
...compat.extends("plugin:hogehoge/recommended")
];
export default [...compat.extends("plugin:hogehoge/recommended")];
```

のようにすることで`.eslintrc.js`形式のsyntaxのルールを利用できます。
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-config/docs/tseslint.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# typescript-eslintについて

VLLでは基本的にTypeScriptを利用しますが、ESLintは本来TypeScriptに対応していません。そこで、[typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)を利用します。
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config/docs/vscode-setup.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Setup ESLint with VSCode

VLLでは基本的にVSCodeの利用を推奨しています。ここではVSCodeにESLintを統合してこのリポジトリのプリセットを動かすための設定を説明します。
Expand All @@ -17,7 +16,7 @@ VLLでは基本的にVSCodeの利用を推奨しています。ここではVSCod
```json
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.eslint": "explicit"
},
"eslint.validate": [
"javascript",
Expand All @@ -33,7 +32,7 @@ VLLでは基本的にVSCodeの利用を推奨しています。ここではVSCod
{
"mode": "auto"
}
],
]
}
```

Expand All @@ -49,5 +48,6 @@ VLLでは基本的にVSCodeの利用を推奨しています。ここではVSCod
"typescript",
"typescriptreact",
"astro"
],
]
}
```
2 changes: 1 addition & 1 deletion packages/eslint-config/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
//@ts-check
export { default } from "@virtual-live-lab/eslint-config/presets/ts"
export { default } from "@virtual-live-lab/eslint-config/presets/ts";
6 changes: 3 additions & 3 deletions packages/eslint-config/src/addons/jsxA11y.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { compat } from "../lib/compat"
import { compat } from "../lib/compat";

const jsxA11y = compat.extends("plugin:jsx-a11y/strict")
const jsxA11y = compat.extends("plugin:jsx-a11y/strict");

export default jsxA11y
export default jsxA11y;
6 changes: 3 additions & 3 deletions packages/eslint-config/src/addons/tailwind.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { compat } from "../lib/compat"
import { compat } from "../lib/compat";

const tailwind = [
...compat.extends("plugin:tailwindcss/recommended"),
Expand All @@ -22,6 +22,6 @@ const tailwind = [
],
},
}),
]
];

export default tailwind
export default tailwind;
8 changes: 4 additions & 4 deletions packages/eslint-config/src/base/astro.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Linter } from "eslint"
import type { Linter } from "eslint";

import eslintPluginAstro from "eslint-plugin-astro"
import eslintPluginAstro from "eslint-plugin-astro";

const astroConfig: Linter.FlatConfig[] = [
...eslintPluginAstro.configs["flat/recommended"],
// flat/jsx-a11y-strictは、eslint-plugin-jsx-a11yの設定をベースにしているので、
// インストールされていないとエラーになるが、このパッケージはdependenciesに含まれているので問題ない
...eslintPluginAstro.configs["flat/jsx-a11y-strict"],
]
];

export { astroConfig }
export { astroConfig };
10 changes: 5 additions & 5 deletions packages/eslint-config/src/base/js.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Linter } from "eslint"
import type { Linter } from "eslint";

import js from "@eslint/js"
import gitignore from "eslint-config-flat-gitignore"
import js from "@eslint/js";
import gitignore from "eslint-config-flat-gitignore";

const jsConfig: Linter.FlatConfig[] = [gitignore(), js.configs.recommended]
const jsConfig: Linter.FlatConfig[] = [gitignore(), js.configs.recommended];

export { jsConfig }
export { jsConfig };
10 changes: 5 additions & 5 deletions packages/eslint-config/src/base/nextjs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Linter } from "eslint"
import type { Linter } from "eslint";

import { compat } from "../lib/compat"
import { reactConfig } from "./react"
import { compat } from "../lib/compat";
import { reactConfig } from "./react";

const nextJsConfig: Linter.FlatConfig[] = [
...reactConfig,
Expand All @@ -13,6 +13,6 @@ const nextJsConfig: Linter.FlatConfig[] = [
Next.jsプリセットを削除するBreaking Changeを行う可能性が高い
*/
...compat.extends("next/core-web-vitals"),
]
];

export { nextJsConfig }
export { nextJsConfig };
14 changes: 7 additions & 7 deletions packages/eslint-config/src/base/react.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Linter } from "eslint"
import type { Linter } from "eslint";

//@ts-expect-error no types
import react from "eslint-plugin-react"
import react from "eslint-plugin-react";
//@ts-expect-error no types
import reactRecommended from "eslint-plugin-react/configs/recommended.js"
import globals from "globals"
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
import globals from "globals";

import { compat } from "../lib/compat"
import { compat } from "../lib/compat";
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const reactConfig: Linter.FlatConfig[] = [
...compat.extends("plugin:react-hooks/recommended"),
Expand All @@ -33,6 +33,6 @@ const reactConfig: Linter.FlatConfig[] = [
"react/jsx-curly-brace-presence": "error",
},
},
]
];

export { reactConfig }
export { reactConfig };
10 changes: 5 additions & 5 deletions packages/eslint-config/src/base/stylistic.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Linter } from "eslint"
import type { Linter } from "eslint";

import prettierConfig from "eslint-config-prettier"
import prettierConfig from "eslint-config-prettier";
// @ts-expect-error no types
import perfectionistNatural from "eslint-plugin-perfectionist/configs/recommended-natural"
import perfectionistNatural from "eslint-plugin-perfectionist/configs/recommended-natural";

// eslint-plugin-perfectionist has no types
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
Expand All @@ -21,6 +21,6 @@ const stylisticConfig: Linter.FlatConfig[] = [
],
},
},
]
];

export { stylisticConfig }
export { stylisticConfig };
8 changes: 4 additions & 4 deletions packages/eslint-config/src/base/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import tseslint from "typescript-eslint"
import tseslint from "typescript-eslint";

import { __dirname } from "../lib/dir"
import { __dirname } from "../lib/dir";

const tsConfig = tseslint.config({
extends: [
Expand Down Expand Up @@ -45,6 +45,6 @@ const tsConfig = tseslint.config({
"@typescript-eslint/prefer-for-of": "off",
"@typescript-eslint/prefer-function-type": "off",
},
})
});

export { tsConfig }
export { tsConfig };
2 changes: 1 addition & 1 deletion packages/eslint-config/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { compat } from "./lib/compat"
export { compat } from "./lib/compat";
8 changes: 4 additions & 4 deletions packages/eslint-config/src/lib/compat.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FlatCompat } from "@eslint/eslintrc"
import { FlatCompat } from "@eslint/eslintrc";

import { __dirname } from "./dir"
import { __dirname } from "./dir";

// 最も近いpackage.jsonを探索して、そのディレクトリをbaseDirectoryとして設定
const compat = new FlatCompat({ baseDirectory: __dirname })
const compat = new FlatCompat({ baseDirectory: __dirname });

export { compat }
export { compat };
4 changes: 2 additions & 2 deletions packages/eslint-config/src/lib/dir.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { packageDirectorySync } from "pkg-dir"
import { packageDirectorySync } from "pkg-dir";

export const __dirname = packageDirectorySync()
export const __dirname = packageDirectorySync();
14 changes: 7 additions & 7 deletions packages/eslint-config/src/presets/astro.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { TSESLint } from "@typescript-eslint/utils"
import type { TSESLint } from "@typescript-eslint/utils";

import tseslint from "typescript-eslint"
import tseslint from "typescript-eslint";

import { astroConfig } from "../base/astro"
import { reactConfig } from "../base/react"
import ts from "./ts"
import { astroConfig } from "../base/astro";
import { reactConfig } from "../base/react";
import ts from "./ts";

const astro: TSESLint.FlatConfig.ConfigArray = tseslint.config(
...ts,
...astroConfig,
...reactConfig,
)
);

export default astro
export default astro;
12 changes: 6 additions & 6 deletions packages/eslint-config/src/presets/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import astro from "./astro"
import js from "./js"
import react from "./react"
import ts from "./ts"
import astro from "./astro";
import js from "./js";
import react from "./react";
import ts from "./ts";

const presets = {
astro,
js,
react,
ts,
}
};

export default presets
export default presets;
8 changes: 4 additions & 4 deletions packages/eslint-config/src/presets/js.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jsConfig } from "../base/js"
import { stylisticConfig } from "../base/stylistic"
import { jsConfig } from "../base/js";
import { stylisticConfig } from "../base/stylistic";

const js = [...jsConfig, ...stylisticConfig]
const js = [...jsConfig, ...stylisticConfig];

export default js
export default js;
Loading

0 comments on commit c46191b

Please sign in to comment.