Skip to content

Commit

Permalink
fix config from v1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
burtek committed Nov 21, 2021
1 parent 8668932 commit 1346236
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 16 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ jobs:
package.json
yarn.lock
eslint-config-*.js
- name: 'Install dependencies'
run: yarn
- name: 'Test configs'
run: yarn test
- name: 'Publish package'
run: |
yarn
yarn publish --tag latest --access public
run: yarn publish --tag latest --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/.github/
/.gitignore
/.markdownlint.json
/.eslintrc
/.eslintrc
/eslint.test.js
12 changes: 0 additions & 12 deletions eslint-config-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,11 @@ module.exports = {
'modifiers': ['const', 'global'],
'format': ['camelCase', 'UPPER_CASE']
},
{
'selector': 'variable',
'modifiers': ['const', 'global', 'exported'],
'type': 'function',
'format': ['camelCase', 'UPPER_CASE', 'PascalCase']
},
{
'selector': 'function',
'modifiers': ['global'],
'format': ['camelCase', 'PascalCase']
},
{
'selector': 'function',
'modifiers': ['const', 'global'],
'filter': /^use/,
'format': ['camelCase']
},
{
'selector': 'parameter',
'modifiers': ['unused'],
Expand Down
54 changes: 54 additions & 0 deletions eslint-config-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,60 @@ module.exports = {
'react/void-dom-elements-no-children': 'error'
},
overrides: [
{
files: ['*.tsx'],
rules: {
'@typescript-eslint/naming-convention': ['error',
{
'selector': 'default',
'format': ['camelCase'],
'leadingUnderscore': 'forbid',
'trailingUnderscore': 'forbid'
},
{
'selector': 'variable',
'modifiers': ['const', 'global'],
'format': ['camelCase', 'UPPER_CASE']
},
{
'selector': 'variable',
'modifiers': ['const', 'global', 'exported'],
'types': ['function'],
'format': ['camelCase', 'UPPER_CASE', 'PascalCase']
},
{
'selector': 'variable',
'modifiers': ['const', 'global', 'exported'],
'types': ['function'],
'filter': '^use',
'format': ['camelCase']
},
{
'selector': 'function',
'modifiers': ['global'],
'format': ['camelCase', 'PascalCase']
},
{
'selector': 'function',
'filter': '^use',
'format': ['camelCase']
},
{
'selector': 'parameter',
'modifiers': ['unused'],
'leadingUnderscore': 'allow',
'format': null
},
{
'selector': 'enumMember',
'format': ['UPPER_CASE']
},
{
'selector': 'typeLike',
'format': ['PascalCase']
}],
}
},
{
files: ['*.jsx', '*.tsx'],
rules: {
Expand Down
23 changes: 23 additions & 0 deletions eslint.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const fs = require('fs');
const eslint = require('eslint');

function getErrors(configFile) {
const ESLint = eslint.ESLint;

const cli = new ESLint({
overrideConfigFile: configFile,
});

return cli.lintText('');
}

fs.readdirSync('.', { withFileTypes: true }).filter(f => f.isFile() && f.name.startsWith('eslint-config') && f.name.endsWith('.js')).forEach(async f => {
try {
await getErrors(f.name);
} catch (error) {
console.error('Error in file', f.name)
console.error(error)

process.exit(1);
}
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
"private": false,
"scripts": {
"test": "node eslint.test.js",
"version": "auto-changelog -p && git add CHANGELOG.md"
},
"repository": {
Expand Down

0 comments on commit 1346236

Please sign in to comment.