sindresorhus / eslint-plugin-unicorn

More than 100 powerful ESLint rules
MIT License
4.17k stars 360 forks source link

Proposal changes on `prevent-abbreviations` #463

Closed fisker closed 4 years ago

fisker commented 4 years ago

I did a little research on how people use prevent-abbreviations, found some reasonable usecase

I think we should add them to whitelist

EmberENV https://api.emberjs.com/ember/3.10/classes/Ember.EmberENV/properties https://github.com/ClarkSource/eslint-config/blob/3f6ca81b44bddbfd6a5cd4a9e00950aa3f2fb213/packages/eslint-config-node/index.js#L28 also launch_in_dev https://guides.emberjs.com/v1.10.0/testing/test-runners/

devDependencies https://github.com/ClarkSource/eslint-config/blob/3f6ca81b44bddbfd6a5cd4a9e00950aa3f2fb213/packages/eslint-config-node/index.js#L41

getInitialProps https://github.com/alienvspredator/typescript-project-template/blob/3b1b19e5bd5bbe6de7c7aadfd4f5c95b238b4e0e/.eslintrc.js#L27 https://github.com/alienvspredator/node-project-boilerplate/blob/15fa866e549258fead6dfbfcabb37fdcdcb38a44/.eslintrc.js#L88 https://nextjs.org/learn/basics/fetching-data-for-pages

devServer https://github.com/mhxbe/react-suspense-experiment/blob/220a75e0c409de0f3b5322ed8b0013815a472fda/.eslintrc.json#L38 https://webpack.js.org/configuration/dev-server/#devserver

setupFilesAfterEnv https://github.com/dbpiper/Euclid/blob/d3c036fa2da48cc67eecc9a616d37dae7b8405fd/src/client/jest.config.js#L35-L37 https://jestjs.io/docs/en/configuration#setupfilesafterenv-array

sindresorhus commented 4 years ago

I agree with everything except for launch_in_dev and devServer. Those are too generic.

fisker commented 4 years ago

envs -> environments app -> application tit -> title seen my colleagues used a lot, this abbr is dirty :(

what do you think

sindresorhus commented 4 years ago

Yes to the first one.

The second one is actually a valid word. I'd rather do application => app.

Not sure about the last one. I have never seen it used before and it could be ambiguous.

fisker commented 4 years ago

https://github.com/search?q=tit+%E6%A0%87%E9%A2%98&type=Code

sindresorhus commented 4 years ago

Alright, we can try adding tit.