@change-org/eslint-plugin-change

Eslint rules for change javascript repos

Usage no npm install needed!

<script type="module">
  import changeOrgEslintPluginChange from 'https://cdn.skypack.dev/@change-org/eslint-plugin-change';
</script>

README

eslint-plugin-change

Custom lint rules for change javascript repos.

Setup

npm install

Available rules

change/prefer-object-spread-to-lodash

Valid

_.extend(foo, { bar: 'baz' });
_.assignIn(foo, { bar: 'baz' });
_.extend({}, ...foo);
_.assignIn({}, ...foo);

Invalid

_.extend({}, foo, { bar: 'baz' });
_.assignIn({}, foo, { bar: 'baz' });
Suggested fix
{
  ...foo,
  bar: 'baz',
};

Development

Run tests

npm test

Creating a new rule

Writing your rule

TODO

https://astexplorer.net/ is very helpful here.

Testing your rule

See https://eslint.org/docs/developer-guide/nodejs-api#ruletester