Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .changeset/gold-insects-wash.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"eslint-config-wantedly-typescript": minor
"eslint-config-wantedly": minor
"@wantedly/eslint-config-wantedly-typescript": minor
"@wantedly/eslint-config-wantedly": minor
---

refactor(eslint-config-wantedly): Refactor rule set
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Restore cache for yarn and lerna
uses: actions/cache@v3.3.2
uses: actions/cache@v4
id: yarn-cache
with:
path: |
Expand All @@ -35,6 +35,11 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

# The shared ESLint config pulls in eslint-plugin-wantedly, whose main entry
# is its build output, so ESLint cannot load without building first.
- name: Build
run: yarn build

- name: Run ESLint
run: |
BASE_BRANCH=${GITHUB_BASE_REF:-master}
Expand All @@ -61,7 +66,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Restore cache for yarn and lerna
uses: actions/cache@v3.3.2
uses: actions/cache@v4
id: yarn-cache
with:
path: |
Expand Down Expand Up @@ -101,7 +106,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Restore cache for yarn and lerna
uses: actions/cache@v3.3.2
uses: actions/cache@v4
id: yarn-cache
with:
path: |
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"prettier-config-wantedly"
"@wantedly/prettier-config-wantedly"
2 changes: 1 addition & 1 deletion .scaffdog/eslint-plugin-wantedly-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const RULE = linter.getRules().get(RULE_NAME) as Rule.RuleModule;
import { RuleTester } from "eslint";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import ESLintConfigWantedly from "eslint-config-wantedly-typescript";
import ESLintConfigWantedly from "@wantedly/eslint-config-wantedly-typescript";
import { RULE, RULE_NAME } from "../{{ input }}";

new RuleTester({
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { base as eslintConfigWantedly } from "eslint-config-wantedly";
import { base as eslintConfigWantedlyTs } from "eslint-config-wantedly-typescript";
import { base as eslintConfigWantedly } from "@wantedly/eslint-config-wantedly";
import { base as eslintConfigWantedlyTs } from "@wantedly/eslint-config-wantedly-typescript";

/** @type{import('eslint').Linter.Config[]} */
export default [
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"postinstall": "lerna bootstrap",
"pretest": "yarn build",
"test": "FORCE_COLOR=1 lerna run --stream test",
"test:watch": "FORCE_COLOR=1 lerna exec --stream --ignore prettier-config-wantedly -- npm run test -- --watch",
"test:watch:frolint": "lerna exec \"npm run test -- --watch\" --scope frolint",
"test:watch": "FORCE_COLOR=1 lerna exec --stream --ignore @wantedly/prettier-config-wantedly -- npm run test -- --watch",
"test:watch:frolint": "lerna exec \"npm run test -- --watch\" --scope @wantedly/frolint",
"test:update": "lerna run --stream test -- -u",
"format": "prettier --write",
"lint": "eslint --cache",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ exports[`eslint-config-wantedly-typescript base should match snapshot for 1`] =
"import",
"jsx-a11y:eslint-plugin-jsx-a11y@6.10.0",
"jest:eslint-plugin-jest@28.8.3",
"use-macros:eslint-plugin-use-macros",
"use-macros:@wantedly/eslint-plugin-use-macros",
"es-x:eslint-plugin-es-x@8.0.0",
],
"processor": undefined,
Expand Down Expand Up @@ -3394,11 +3394,11 @@ exports[`eslint-config-wantedly-typescript react should match snapshot for 1`] =
"import",
"jsx-a11y:eslint-plugin-jsx-a11y@6.10.0",
"jest:eslint-plugin-jest@28.8.3",
"use-macros:eslint-plugin-use-macros",
"use-macros:@wantedly/eslint-plugin-use-macros",
"es-x:eslint-plugin-es-x@8.0.0",
"react",
"react-hooks",
"wantedly:eslint-plugin-wantedly",
"wantedly:@wantedly/eslint-plugin-wantedly",
],
"processor": undefined,
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-wantedly-typescript/base.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const eslintJs = require("@eslint/js");
const pluginUseMacros = require("@wantedly/eslint-plugin-use-macros");
const configPrettier = require("eslint-config-prettier");
const pluginESx = require("eslint-plugin-es-x");
const pluginImport = require("eslint-plugin-import");
const pluginJest = require("eslint-plugin-jest");
const pluginJsxA11y = require("eslint-plugin-jsx-a11y");
const pluginUseMacros = require("eslint-plugin-use-macros");
const globals = require("globals");
const eslintTs = require("typescript-eslint");

Expand Down
7 changes: 4 additions & 3 deletions packages/eslint-config-wantedly-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "eslint-config-wantedly-typescript",
"name": "@wantedly/eslint-config-wantedly-typescript",
"description": "ESLint configuration for Wantedly with TypeScript",
"version": "4.0.0",
"author": "Yuki Yamada <yamada@wantedly.com>",
Expand All @@ -14,8 +14,8 @@
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-use-macros": "^4.0.0",
"eslint-plugin-wantedly": "^4.0.0",
"@wantedly/eslint-plugin-use-macros": "^4.0.0",
"@wantedly/eslint-plugin-wantedly": "^4.0.0",
"globals": "^15.9.0",
"typescript-eslint": "^8.6.0"
},
Expand All @@ -30,6 +30,7 @@
"main": "index.js",
"private": false,
"publishConfig": {
"registry": "https://npm.pkg.github.com",
"access": "public"
},
"repository": "https://github.com/wantedly/frolint/tree/master/packages/eslint-config-wantedly-typescript",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-wantedly-typescript/react.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const pluginWantedly = require("@wantedly/eslint-plugin-wantedly");
const pluginReact = require("eslint-plugin-react");
const pluginReactHooks = require("eslint-plugin-react-hooks");
const pluginWantedly = require("eslint-plugin-wantedly");
const eslintTs = require("typescript-eslint");

const baseConfig = require("./base");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ exports[`eslint-config-wantedly base should match snapshot for 1`] = `
"import",
"jsx-a11y:eslint-plugin-jsx-a11y@6.10.0",
"jest:eslint-plugin-jest@28.8.3",
"use-macros:eslint-plugin-use-macros",
"use-macros:@wantedly/eslint-plugin-use-macros",
"es-x:eslint-plugin-es-x@8.0.0",
],
"processor": undefined,
Expand Down Expand Up @@ -3263,7 +3263,7 @@ exports[`eslint-config-wantedly react should match snapshot for 1`] = `
"import",
"jsx-a11y:eslint-plugin-jsx-a11y@6.10.0",
"jest:eslint-plugin-jest@28.8.3",
"use-macros:eslint-plugin-use-macros",
"use-macros:@wantedly/eslint-plugin-use-macros",
"es-x:eslint-plugin-es-x@8.0.0",
"react",
"react-hooks",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-wantedly/base.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const babelEslintParser = require("@babel/eslint-parser");
const js = require("@eslint/js");
const pluginUseMacros = require("@wantedly/eslint-plugin-use-macros");
const configPrettier = require("eslint-config-prettier");
const pluginESx = require("eslint-plugin-es-x");
const pluginImport = require("eslint-plugin-import");
const pluginJest = require("eslint-plugin-jest");
const pluginJsxA11Y = require("eslint-plugin-jsx-a11y");
const pluginUseMacros = require("eslint-plugin-use-macros");
const globals = require("globals");

/** @type{import('eslint').Linter.Config[]} */
Expand Down
5 changes: 3 additions & 2 deletions packages/eslint-config-wantedly/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "eslint-config-wantedly",
"name": "@wantedly/eslint-config-wantedly",
"description": "ESLint configuration for Wantedly",
"version": "4.0.0",
"author": "Yuki Yamada <yamada@wantedly.com>",
Expand All @@ -15,7 +15,7 @@
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-use-macros": "^4.0.0",
"@wantedly/eslint-plugin-use-macros": "^4.0.0",
"globals": "^15.9.0"
},
"homepage": "https://github.com/wantedly/frolint",
Expand All @@ -26,6 +26,7 @@
"main": "index.js",
"private": false,
"publishConfig": {
"registry": "https://npm.pkg.github.com",
"access": "public"
},
"repository": "https://github.com/wantedly/frolint/tree/master/packages/eslint-config-wantedly",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-use-macros/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const StyledComponents = require("./rules/StyledComponents");
/** @type {import('eslint').ESLint.Plugin } */
module.exports = {
meta: {
name: "eslint-plugin-use-macros",
name: "@wantedly/eslint-plugin-use-macros",
},
rules: {
"graphql-tag": GraphQLTag,
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin-use-macros/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "eslint-plugin-use-macros",
"name": "@wantedly/eslint-plugin-use-macros",
"description": "ESLint rules for libraries which supports the babel-macros",
"version": "4.0.1",
"author": "Yuki Yamada <yamada@wantedly.com>",
Expand All @@ -12,6 +12,7 @@
"license": "MIT",
"main": "index.js",
"publishConfig": {
"registry": "https://npm.pkg.github.com",
"access": "public"
},
"repository": "https://github.com/wantedly/frolint/tree/master/packages/eslint-plugin-use-macros",
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin-wantedly/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "eslint-plugin-wantedly",
"name": "@wantedly/eslint-plugin-wantedly",
"description": "Opinionated ESLint plugin for Wantedly",
"version": "4.0.1",
"author": "Yuki Yamada <yamada@wantedly.com>",
Expand All @@ -12,6 +12,7 @@
"license": "MIT",
"main": "lib/index.js",
"publishConfig": {
"registry": "https://npm.pkg.github.com",
"access": "public"
},
"repository": "https://github.com/wantedly/frolint/tree/master/packages/eslint-plugin-wantedly",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`should match snapshot 1`] = `
{
"default": {
"meta": {
"name": "eslint-plugin-wantedly",
"name": "@wantedly/eslint-plugin-wantedly",
},
"rules": {
"graphql-operation-name": {
Expand Down Expand Up @@ -144,7 +144,7 @@ exports[`should match snapshot 1`] = `
},
},
"meta": {
"name": "eslint-plugin-wantedly",
"name": "@wantedly/eslint-plugin-wantedly",
},
"rules": {
"graphql-operation-name": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-wantedly/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as NEXUS_UPPER_CASE_ENUM_MEMBERS from "./rules/nexus-upper-case-enum-me

const plugins: ESLint.Plugin = {
meta: {
name: "eslint-plugin-wantedly",
name: "@wantedly/eslint-plugin-wantedly",
},
rules: {
[GRAPHQL_OPERATION_NAME.RULE_NAME]: GRAPHQL_OPERATION_NAME.RULE,
Expand Down
9 changes: 5 additions & 4 deletions packages/frolint/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "frolint",
"name": "@wantedly/frolint",
"description": "git commit hook linter",
"version": "4.0.0",
"author": "Yuki Yamada <yamada@wantedly.com>",
Expand All @@ -11,10 +11,10 @@
"cosmiconfig": "^7.0.0",
"debug": "^4.3.2",
"eslint": "^9.0.0",
"eslint-config-wantedly": "^4.0.0",
"eslint-config-wantedly-typescript": "^4.0.0",
"@wantedly/eslint-config-wantedly": "^4.0.0",
"@wantedly/eslint-config-wantedly-typescript": "^4.0.0",
"prettier": "^2.4.1",
"prettier-config-wantedly": "^3.2.2",
"@wantedly/prettier-config-wantedly": "^3.2.2",
"resolve": "^1.20.0"
},
"homepage": "https://github.com/wantedly/frolint",
Expand All @@ -24,6 +24,7 @@
],
"license": "MIT",
"publishConfig": {
"registry": "https://npm.pkg.github.com",
"access": "public"
},
"repository": "https://github.com/wantedly/frolint/tree/master/packages/frolint",
Expand Down
2 changes: 1 addition & 1 deletion packages/frolint/src/commands/ExportCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class ExportCommand extends Command<FrolintContext> {
log("Prettier config file not found");

if (err && (err as NodeJS.ErrnoException).code === "ENOENT") {
const prettierrcContent = `"prettier-config-wantedly"\n`;
const prettierrcContent = `"@wantedly/prettier-config-wantedly"\n`;

log("Export Prettier config file");

Expand Down
2 changes: 1 addition & 1 deletion packages/frolint/src/commands/InstallCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class InstallCommand extends Command<FrolintContext> {
function render({ append }: { append: boolean }) {
return `${append ? "" : "#!/bin/sh\n"}${START_COMMENT}

scriptPath="node_modules/frolint/index.js"
scriptPath="node_modules/@wantedly/frolint/index.js"
hookName="pre-commit"
gitParams="$*"

Expand Down
2 changes: 1 addition & 1 deletion packages/frolint/src/utils/prettier.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { readFileSync } from "fs";
import { extname, resolve } from "path";

import prettierConfigWantedly from "@wantedly/prettier-config-wantedly";
import type { BuiltInParserName, ResolveConfigOptions } from "prettier";
import prettier from "prettier";
import prettierConfigWantedly from "prettier-config-wantedly";

import type { FrolintConfig } from "../Context";

Expand Down
3 changes: 2 additions & 1 deletion packages/prettier-config-wantedly/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "prettier-config-wantedly",
"name": "@wantedly/prettier-config-wantedly",
"version": "3.2.2",
"description": "Prettier configuration for Wantedly",
"keywords": [
Expand All @@ -10,6 +10,7 @@
"license": "MIT",
"main": "index.json",
"publishConfig": {
"registry": "https://npm.pkg.github.com",
"access": "public"
},
"repository": "https://github.com/wantedly/frolint/tree/master/packages/prettier-config-wantedly"
Expand Down
Loading