Phillip9587 / nx-stylelint

Nx plugin to use Stylelint in your Nx workspace.
MIT License
84 stars 15 forks source link

Generator wipes out previous targets #145

Closed nickroberts closed 3 years ago

nickroberts commented 3 years ago

When generating a config for a project, it replaces the entire targets object, instead of appending to it.

This was done on the latest create-nx-workspace, with the default app named site.

Before project.json

{
  "root": "apps/site",
  "sourceRoot": "apps/site",
  "projectType": "application",
  "targets": {
    "build": {
      "executor": "@nrwl/next:build",
      "outputs": ["{options.outputPath}"],
      "defaultConfiguration": "production",
      "options": {
        "root": "apps/site",
        "outputPath": "dist/apps/site"
      },
      "configurations": {
        "production": {}
      }
    },
    "serve": {
      "executor": "@nrwl/next:server",
      "options": {
        "buildTarget": "site:build",
        "dev": true
      },
      "configurations": {
        "production": {
          "buildTarget": "site:build:production",
          "dev": false
        }
      }
    },
    "export": {
      "executor": "@nrwl/next:export",
      "options": {
        "buildTarget": "site:build:production"
      }
    },
    "test": {
      "executor": "@nrwl/jest:jest",
      "outputs": ["coverage/apps/site"],
      "options": {
        "jestConfig": "apps/site/jest.config.js",
        "passWithNoTests": true
      }
    },
    "lint": {
      "executor": "@nrwl/linter:eslint",
      "outputs": ["{options.outputFile}"],
      "options": {
        "lintFilePatterns": ["apps/site/**/*.{ts,tsx,js,jsx}"]
      }
    }
  },
  "tags": []
}

Command ran

nx g nx-stylelint:configuration --project site

After project.json

{
  "root": "apps/site",
  "sourceRoot": "apps/site",
  "projectType": "application",
  "targets": {
    "stylelint": {
      "executor": "nx-stylelint:lint",
      "options": {
        "config": "apps/site/.stylelintrc.json",
        "lintFilePatterns": ["apps/site/**/*.css"]
      }
    }
  },
  "tags": []
}
Phillip9587 commented 3 years ago

@nickroberts I'm sorry I will fix this immediately

Phillip9587 commented 3 years ago

@nickroberts Should be fixed in nx-stylelint@12.3.1