1.0.0 • Published 5 years ago
@evgenymarkov/codestyle v1.0.0
@evgenymarkov/codestyle
Utilities for maintaining code style
Installation
npm install --save-dev @evgenymarkov/codestyle typescriptConfiguration
EditorConfig
.editorconfig:
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = truePrettier
.prettierrc.js:
'use strict';
const prettierConfig = require('@evgenymarkov/codestyle/prettier');
module.exports = {
  ...prettierConfig,
};.prettierignore:
# NPM
node_modules/
package.json
package-lock.jsonStylelint
.stylelintrc.js:
'use strict';
const stylelintConfig = require('@evgenymarkov/codestyle/stylelint');
module.exports = {
  ...stylelintConfig,
};.stylelintignore:
# NPM
node_modules/ESLint
For server side
.eslintrc.js:
'use strict';
const eslintNodeConfig = require('@evgenymarkov/codestyle/eslint/node');
module.exports = {
  root: true,
  ...eslintNodeConfig({
    additionalPaths: ['.'], // Like NODE_PATH, this is optional
    jsOptions: {
      sourceType: 'script', // Choose CommonJS or ECMAScript modules
    },
    tsOptions: {
      rootDir: __dirname,
      project: ['./tsconfig.json'],
    },
  }),
};.eslintignore:
# NPM
node_modules/For client side
.eslintrc.js:
'use strict';
const eslintBrowserConfig = require('@evgenymarkov/codestyle/eslint/browser');
module.exports = {
  root: true,
  ...eslintBrowserConfig({
    additionalPaths: ['.'], // Like resolve.modules in Webpack config
    tsOptions: {
      rootDir: __dirname,
      project: ['./tsconfig.json'],
    },
  }),
};.eslintignore:
# NPM
node_modules/1.0.0
5 years ago