UNPKG

576 BJavaScriptView Raw
1const { multilineFixer } = require('./es-beautifier-common.js');
2
3const create = (context) => {
4 const sourceCode = context.getSourceCode();
5
6 const enterClassBody = multilineFixer({
7 context,
8 sourceCode,
9 childrenName: 'body',
10 message: 'Method definition in a class body must be on a new line.',
11 });
12
13 return {
14 ClassBody: enterClassBody,
15 };
16};
17
18module.exports = {
19 meta: {
20 docs: {
21 description: 'enforce multi-line method definitions in a class body',
22 category: 'Stylistic Issues',
23 },
24 fixable: 'whitespace',
25 },
26 create,
27};