Skip to content

Commit

Permalink
MNT Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Nov 9, 2023
1 parent 4f79962 commit 4311197
Show file tree
Hide file tree
Showing 331 changed files with 13,103 additions and 11,063 deletions.
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[composer.json]
indent_size = 4
indent_size = 4
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,24 @@ rules.overrides = [
impliedStrict: true
}
},
settings: {
react: {
version: '16'
}
},
rules: {
// These rules are not appropriate for linting markdown code blocks
'lines-around-comment': 'off',
'import/no-unresolved': 'off',
'import/extensions': 'off',
'react/jsx-no-undef': 'off',
'no-undef': 'off',
'no-unused-expressions': 'off',
'no-unused-vars': 'off',
'brace-style': 'off', // it's useful to have comments before the else block
// These rules are disabled because they are difficult to adhere to right now
'jsx-a11y/label-has-associated-control': 'off',
'react/prefer-stateless-function': 'off',
}
}
];
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
node-version: ${{ steps.read-nvm.outputs.version }}

- name: Install yarn and dependencies
- name: Install yarn dependencies
run: |
npm install --global yarn
yarn install
Expand All @@ -44,7 +44,7 @@ jobs:

- name: Install composer dependencies
if: ${{ matrix.script == 'lint-php' }}
run: composer install --prefer-dist --no-progress --ansi --no-interaction --no-scripts --no-plugins --optimize-autoloader
run: composer install --prefer-dist --no-progress --ansi --no-interaction --optimize-autoloader

- name: Run lint
run: yarn ${{ matrix.script }}
71 changes: 68 additions & 3 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
# Enable all rules with default settings as a baseline
default: true

customRules:
- 'markdownlint-rule-title-case-style'

# markdownlint-rule-title-case-style: Use sentence-style headings
title-case-style:
case: 'sentence'
ignore:
- 'Apache'
- 'APIs'
- 'Composer'
- 'GitHub'
- 'GraphQL'
- 'Huntr'
- 'JavaScript'
- 'I'
- 'InnoDB'
- 'Git'
- 'jQuery'
- 'jQuery,'
- 'Lighttpd'
- 'MyISAM'
- 'MySQL'
- 'Nginx'
- 'Nginx,'
- 'PHPUnit'
- 'RFCs'
- 'Silverstripe'
- 'TinyMCE'
- 'Transifex'
- 'URLs'
- 'WebP'

# MD041: Ignore the frontmatter (metadata) title when checking for H1s
first-line-h1:
Expand Down Expand Up @@ -78,27 +90,80 @@ fenced-code-language:
allowed_languages:
- 'bash' # use this instead of shell or env
- 'css'
- 'diff'
- 'graphql'
- 'html'
- 'js'
- 'json'
- 'php'
- 'scss'
- 'ss'
- 'sql'
- 'text'
- 'xml'
- 'yml'

# MD044: Enforces capitalisation for specific names
proper-names:
code_blocks: false
names:
- 'API'
- '-api' # e.g. "#breaking-api" in anchor links
- '#api' # anchor links
- 'type/api-break' # the GitHub label
- 'CI'
- '-ci' # e.g. "#using-ci" in anchor links
- 'CMS'
- '/cms' # e.g. "silverstripe/cms"
- '-cms' # e.g. "silverstripe/recipe-cms"
- '#cms' # anchor links
- 'CSS'
- 'GitHub'
- 'GraphQL'
- '#graphql' # anchor links
- '-graphql' # e.g. "#define-graphql" in anchor links
- '/graphql' # e.g. "silverstripe/graphql"
- 'HTTP'
- 'JavaScript'
- 'JS'
- '#js' # anchor links
- '-js' # e.g. "#history-viewer-js" in anchor links
- '.js' # e.g. "Node.js"
- 'jQuery'
- '#jquery' # anchor links
- 'ORM'
- '#orm' # anchor links
- '-orm' # e.g. "#overview-orm" in anchor links
- 'PHP'
- '-php' # e.g. "#config-php" in anchor links
- 'php-' # e.g. "php-intl extension"
- '#php' # anchor links
- 'SCSS'
- 'Silverstripe'
- '#silverstripe/' # anchor links
- 'silverstripe/' # e.g. "silverstripe/framework"
- 'silverstripe-' # e.g. "silverstripe-vendormodule"
- 'SilverStripe\' # e.g. api links
- 'silverstripe.com'
- 'silverstripe.org'
- 'TinyMCE'
- '#tinymce' # anchor links
- 'UI'
- '-ui' # e.g. "#installer-ui" in anchor links
- 'URL'
- '-url' # e.g. "#admin-ui" in anchor links
- 'YAML'
- '-yaml' # e.g. "#split-yaml" in anchor links

# MD033: Allow specific HTML tags
no-inline-html:
allowed_elements:
# br is necessary for new lines in tables
- 'br'
# accordians are okay
- 'details'
- 'summary'
# description lists are okay
- 'dl'
- 'dd'
- 'dt'
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@
}
],
"require-dev": {
"silverstripe/markdown-php-codesniffer": "dev-pulls/1/new-repo"
"silverstripe/markdown-php-codesniffer": "dev-pulls/1/new-repo",
"slevomat/coding-standard": "^8.14"
},
"repositories": [
{
"url": "https://github.com/creative-commoners/markdown-php-codesniffer",
"type": "vcs"
}
]
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit 4311197

Please sign in to comment.