Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ignoredNodes: []
}
];
module.exports = Object.assign({}, baseRule, {
meta: {
type: 'layout',
docs: {
description: 'Enforce consistent indentation',
extraDescription: [util.tslintRule('indent')],
category: 'Stylistic Issues',
recommended: 'error',
url: util.metaDocsUrl('indent')
},
fixable: 'whitespace',
schema: baseRule.meta.schema,
messages: baseRule.meta.messages
},
create(context) {
// because we extend the base rule, have to update opts on the context
// the context defines options as readonly though...
const contextWithDefaults = Object.create(context, {
options: {
writable: false,
configurable: false,
value: util.applyDefault(defaultOptions, context.options)
}
});
const rules = baseRule.create(contextWithDefaults);
}
];
module.exports = Object.assign({}, baseRule, {
meta: {
type: 'layout',
docs: {
description: 'Enforce consistent indentation',
extraDescription: [util.tslintRule('indent')],
category: 'Stylistic Issues',
recommended: 'error',
url: util.metaDocsUrl('indent')
},
fixable: 'whitespace',
schema: baseRule.meta.schema,
messages: baseRule.meta.messages
},
create(context) {
// because we extend the base rule, have to update opts on the context
// the context defines options as readonly though...
const contextWithDefaults = Object.create(context, {
options: {
writable: false,
configurable: false,
value: util.applyDefault(defaultOptions, context.options)
}
});
const rules = baseRule.create(contextWithDefaults);
/**
AST_NODE_TYPES.TSUnionType,
AST_NODE_TYPES.Decorator,
]);
export default util.createRule({
name: 'indent',
meta: {
type: 'layout',
docs: {
description: 'Enforce consistent indentation',
category: 'Stylistic Issues',
// too opinionated to be recommended
recommended: false,
},
fixable: 'whitespace',
schema: baseRule.meta.schema,
messages: baseRule.meta.messages,
},
defaultOptions: [
// typescript docs and playground use 4 space indent
4,
{
// typescript docs indent the case from the switch
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#example-4
SwitchCase: 1,
flatTernaryExpressions: false,
ignoredNodes: [],
},
],
create(context, optionsWithDefaults) {
// because we extend the base rule, have to update opts on the context
// the context defines options as readonly though...
AST_NODE_TYPES.Decorator,
]);
export default util.createRule({
name: 'indent',
meta: {
type: 'layout',
docs: {
description: 'Enforce consistent indentation',
category: 'Stylistic Issues',
// too opinionated to be recommended
recommended: false,
},
fixable: 'whitespace',
schema: baseRule.meta.schema,
messages: baseRule.meta.messages,
},
defaultOptions: [
// typescript docs and playground use 4 space indent
4,
{
// typescript docs indent the case from the switch
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#example-4
SwitchCase: 1,
flatTernaryExpressions: false,
ignoredNodes: [],
},
],
create(context, optionsWithDefaults) {
// because we extend the base rule, have to update opts on the context
// the context defines options as readonly though...
const contextWithDefaults: typeof context = Object.create(context, {