shashkovdanil / clean-publish

Removing configuration files and fields in package.json before publishing to npm
https://www.npmjs.com/package/clean-publish
MIT License
313 stars 18 forks source link

Unexpected cleaning while `--clean-comments` #154

Open isuvorov opened 11 months ago

isuvorov commented 11 months ago

Example: test.js


// TODO: something

module.exports = {
  env: {
    browser: false,
    node: true,
  },
  extends: ['airbnb-base', 'prettier'],
  plugins: ['simple-import-sort', 'prettier'],
  ignorePatterns: [
    '**/node_modules/**',
    '**/__*/**',
    '**/lib/**',
    '**/dist/**',
    '**/build/**',
    '**/coverage/**',
    '**/public/**',
    '!.gitlab-ci.js',
  ],
};

Expected result:

module.exports = {
  env: {
    browser: false,
    node: true,
  },
  extends: ['airbnb-base', 'prettier'],
  plugins: ['simple-import-sort', 'prettier'],
  ignorePatterns: [
    '**/node_modules/**',
    '**/__*/**',
    '**/lib/**',
    '**/dist/**',
    '**/build/**',
    '**/coverage/**',
    '**/public/**',
    '!.gitlab-ci.js',
  ],
};

Actual result:

module.exports = {
  env: {
    browser: false,
    node: true,
  },
  extends: ['airbnb-base', 'prettier'],
  plugins: ['simple-import-sort', 'prettier'],
  ignorePatterns: [
    '**/node_modules
__*
lib
dist
build
coverage
public/**',
    '!.gitlab-ci.js',
  ],
};

P.S. For now I have turned off the option in projects, if no one takes it in 2 weeks I will fix the regular schedule at Christmas

Пока в проектах опцию выключил, если никто не возьмется за 2 недели пофикшу регулярку на рождественских

ai commented 11 months ago

I added this feature just for Nano ID.

If you need to make it smarter, you need to send PR :)