mirror of
https://github.com/sasjs/lint.git
synced 2025-12-10 17:34:36 +00:00
Merge pull request #25 from sasjs/group-rules
chore(*): organise rules into folders by type
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { hasDoxygenHeader } from './hasDoxygenHeader'
|
||||
|
||||
describe('hasDoxygenHeader', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FileLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { FileLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
|
||||
const name = 'hasDoxygenHeader'
|
||||
const description =
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { hasMacroNameInMend } from './hasMacroNameInMend'
|
||||
|
||||
describe('hasMacroNameInMend', () => {
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Diagnostic } from '../types/Diagnostic'
|
||||
import { FileLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { trimComments } from '../utils/trimComments'
|
||||
import { getColumnNumber } from '../utils/getColumnNumber'
|
||||
import { Diagnostic } from '../../types/Diagnostic'
|
||||
import { FileLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { trimComments } from '../../utils/trimComments'
|
||||
import { getColumnNumber } from '../../utils/getColumnNumber'
|
||||
|
||||
const name = 'hasMacroNameInMend'
|
||||
const description =
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { hasMacroParentheses } from './hasMacroParentheses'
|
||||
|
||||
describe('hasMacroParentheses', () => {
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Diagnostic } from '../types/Diagnostic'
|
||||
import { FileLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { trimComments } from '../utils/trimComments'
|
||||
import { getColumnNumber } from '../utils/getColumnNumber'
|
||||
import { Diagnostic } from '../../types/Diagnostic'
|
||||
import { FileLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { trimComments } from '../../utils/trimComments'
|
||||
import { getColumnNumber } from '../../utils/getColumnNumber'
|
||||
|
||||
const name = 'hasMacroParentheses'
|
||||
const description = 'Enforces the presence of parentheses in macro definitions.'
|
||||
4
src/rules/file/index.ts
Normal file
4
src/rules/file/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export { hasDoxygenHeader } from './hasDoxygenHeader'
|
||||
export { hasMacroNameInMend } from './hasMacroNameInMend'
|
||||
export { hasMacroParentheses } from './hasMacroParentheses'
|
||||
export { noNestedMacros } from './noNestedMacros'
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { noNestedMacros } from './noNestedMacros'
|
||||
|
||||
describe('noNestedMacros', () => {
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Diagnostic } from '../types/Diagnostic'
|
||||
import { FileLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { trimComments } from '../utils/trimComments'
|
||||
import { getColumnNumber } from '../utils/getColumnNumber'
|
||||
import { Diagnostic } from '../../types/Diagnostic'
|
||||
import { FileLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { trimComments } from '../../utils/trimComments'
|
||||
import { getColumnNumber } from '../../utils/getColumnNumber'
|
||||
|
||||
const name = 'noNestedMacros'
|
||||
const description = 'Enfoces the absence of nested macro definitions.'
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LintConfig, Severity } from '../types'
|
||||
import { LintConfig, Severity } from '../../types'
|
||||
import { indentationMultiple } from './indentationMultiple'
|
||||
|
||||
describe('indentationMultiple', () => {
|
||||
@@ -1,7 +1,7 @@
|
||||
import { LintConfig } from '../types'
|
||||
import { LineLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { LintConfig } from '../../types'
|
||||
import { LineLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
|
||||
const name = 'indentationMultiple'
|
||||
const description = 'Ensure indentation by a multiple of the configured number.'
|
||||
5
src/rules/line/index.ts
Normal file
5
src/rules/line/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { indentationMultiple } from './indentationMultiple'
|
||||
export { maxLineLength } from './maxLineLength'
|
||||
export { noEncodedPasswords } from './noEncodedPasswords'
|
||||
export { noTabIndentation } from './noTabIndentation'
|
||||
export { noTrailingSpaces } from './noTrailingSpaces'
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LintConfig, Severity } from '../types'
|
||||
import { LintConfig, Severity } from '../../types'
|
||||
import { maxLineLength } from './maxLineLength'
|
||||
|
||||
describe('maxLineLength', () => {
|
||||
@@ -1,7 +1,7 @@
|
||||
import { LintConfig } from '../types'
|
||||
import { LineLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { LintConfig } from '../../types'
|
||||
import { LineLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
|
||||
const name = 'maxLineLength'
|
||||
const description = 'Restrict lines to the specified length.'
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { noEncodedPasswords } from './noEncodedPasswords'
|
||||
|
||||
describe('noEncodedPasswords', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LineLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { LineLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
|
||||
const name = 'noEncodedPasswords'
|
||||
const description = 'Disallow encoded passwords in SAS code.'
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { noTabIndentation } from './noTabIndentation'
|
||||
|
||||
describe('noTabs', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LineLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { LineLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
|
||||
const name = 'noTabs'
|
||||
const description = 'Disallow indenting with tabs.'
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { noTrailingSpaces } from './noTrailingSpaces'
|
||||
|
||||
describe('noTrailingSpaces', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LineLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { LineLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
|
||||
const name = 'noTrailingSpaces'
|
||||
const description = 'Disallow trailing spaces on lines.'
|
||||
2
src/rules/path/index.ts
Normal file
2
src/rules/path/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { lowerCaseFileNames } from './lowerCaseFileNames'
|
||||
export { noSpacesInFileNames } from './noSpacesInFileNames'
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { lowerCaseFileNames } from './lowerCaseFileNames'
|
||||
|
||||
describe('lowerCaseFileNames', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PathLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { PathLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import path from 'path'
|
||||
|
||||
const name = 'lowerCaseFileNames'
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import { noSpacesInFileNames } from './noSpacesInFileNames'
|
||||
|
||||
describe('noSpacesInFileNames', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PathLintRule } from '../types/LintRule'
|
||||
import { LintRuleType } from '../types/LintRuleType'
|
||||
import { Severity } from '../types/Severity'
|
||||
import { PathLintRule } from '../../types/LintRule'
|
||||
import { LintRuleType } from '../../types/LintRuleType'
|
||||
import { Severity } from '../../types/Severity'
|
||||
import path from 'path'
|
||||
|
||||
const name = 'noSpacesInFileNames'
|
||||
@@ -1,14 +1,17 @@
|
||||
import { hasDoxygenHeader } from '../rules/hasDoxygenHeader'
|
||||
import { indentationMultiple } from '../rules/indentationMultiple'
|
||||
import { lowerCaseFileNames } from '../rules/lowerCaseFileNames'
|
||||
import { maxLineLength } from '../rules/maxLineLength'
|
||||
import { noEncodedPasswords } from '../rules/noEncodedPasswords'
|
||||
import { noSpacesInFileNames } from '../rules/noSpacesInFileNames'
|
||||
import { noTabIndentation } from '../rules/noTabIndentation'
|
||||
import { noTrailingSpaces } from '../rules/noTrailingSpaces'
|
||||
import { hasMacroNameInMend } from '../rules/hasMacroNameInMend'
|
||||
import { noNestedMacros } from '../rules/noNestedMacros'
|
||||
import { hasMacroParentheses } from '../rules/hasMacroParentheses'
|
||||
import {
|
||||
hasDoxygenHeader,
|
||||
hasMacroNameInMend,
|
||||
noNestedMacros,
|
||||
hasMacroParentheses
|
||||
} from '../rules/file'
|
||||
import {
|
||||
indentationMultiple,
|
||||
maxLineLength,
|
||||
noEncodedPasswords,
|
||||
noTabIndentation,
|
||||
noTrailingSpaces
|
||||
} from '../rules/line'
|
||||
import { lowerCaseFileNames, noSpacesInFileNames } from '../rules/path'
|
||||
import { FileLintRule, LineLintRule, PathLintRule } from './LintRule'
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user