Skip to content

Commit

Permalink
Merge pull request #242 from marp-team/eslint-recommended
Browse files Browse the repository at this point in the history
Use ESLint recommended config instead of eslint-config-airbnb
  • Loading branch information
yhatt authored May 9, 2020
2 parents bd9d31d + c449e32 commit c23ec59
Show file tree
Hide file tree
Showing 33 changed files with 53 additions and 80 deletions.
18 changes: 8 additions & 10 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
env:
node: true
es6: true
node: true

extends:
- airbnb-base
- eslint:recommended
- plugin:import/recommended
- prettier

parser: babel-eslint

rules:
import/order:
- error
- alphabetize:
order: 'asc'

max-len:
- error
- 80
Expand All @@ -18,11 +24,3 @@ rules:
ignoreRegExpLiterals: true
ignoreStrings: true
ignoreTemplateLiterals: true

no-param-reassign: off

no-restricted-syntax:
- error
- ForInStatement
- LabeledStatement
- WithStatement
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### Changed

- Upgrade dependent packages to the latest version ([#241](https://github.com/marp-team/marpit/pull/241))
- Use ESLint recommended config instead of `eslint-config-airbnb` ([#242](https://github.com/marp-team/marpit/pull/242))

## v1.5.3 - 2020-05-04

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"docs:style": "node ./docsify/build.js",
"format": "prettier \"**/*.{css,html,js,json,md,scss,ts,yaml,yml}\"",
"jsdoc": "rimraf jsdoc && jsdoc src -c .jsdoc.json",
"lint:js": "eslint .",
"lint:js": "eslint --report-unused-disable-directives .",
"lint:css": "stylelint \"./**/*.{css,scss}\"",
"prepack": "npm-run-all --parallel check:* lint:* test:coverage --sequential build",
"preversion": "run-p check:* lint:* test:coverage",
Expand All @@ -75,7 +75,6 @@
"dedent": "^0.7.0",
"docsify-themeable": "^0.8.1",
"eslint": "^7.0.0",
"eslint-config-airbnb-base": "14.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"jest": "^26.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/background_image/advanced.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @module */
import marpitPlugin from '../../plugin'
import InlineStyle from '../../helpers/inline_style'
import wrapTokens from '../../helpers/wrap_tokens'
import marpitPlugin from '../../plugin'

/**
* Marpit advanced background image plugin.
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/comment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @module */
import yaml from './directives/yaml'
import marpitPlugin from '../plugin'
import yaml from './directives/yaml'

const commentMatcher = /<!--+\s*([\s\S]*?)\s*--+>/
const commentMatcherOpening = /^<!--/
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/container.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @module */
import marpitPlugin from '../plugin'
import wrapArray from '../helpers/wrap_array'
import wrapTokens from '../helpers/wrap_tokens'
import marpitPlugin from '../plugin'

/**
* Marpit container plugin.
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/directives/apply.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @module */
import kebabCase from 'lodash.kebabcase'
import builtInDirectives from './directives'
import marpitPlugin from '../../plugin'
import InlineStyle from '../../helpers/inline_style'
import marpitPlugin from '../../plugin'
import builtInDirectives from './directives'

/**
* Apply parsed Marpit directives to markdown-it tokens.
Expand Down
6 changes: 3 additions & 3 deletions src/markdown/directives/parse.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/** @module */
import MarkdownItFrontMatter from 'markdown-it-front-matter'
import yaml from './yaml'
import * as directives from './directives'
import { markAsParsed } from '../comment'
import marpitPlugin from '../../plugin'
import { markAsParsed } from '../comment'
import * as directives from './directives'
import yaml from './yaml'

const isDirectiveComment = (token) =>
token.type === 'marpit_comment' && token.meta.marpitParsedDirectives
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/header_and_footer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @module */
import marpitPlugin from '../plugin'
import wrapTokens from '../helpers/wrap_tokens'
import marpitPlugin from '../plugin'

/**
* Marpit header and footer plugin.
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/heading_divider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @module */
import marpitPlugin from '../plugin'
import split from '../helpers/split'
import marpitPlugin from '../plugin'

/**
* Marpit heading divider plugin.
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/image/apply.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @module */
import marpitPlugin from '../../plugin'
import InlineStyle from '../../helpers/inline_style'
import marpitPlugin from '../../plugin'

/**
* Marpit image apply plugin.
Expand Down
1 change: 0 additions & 1 deletion src/markdown/image/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ function parseImage(md) {

try {
md.normalizeLink = (url) => {
// eslint-disable-next-line no-new-wrappers
const imprimitiveUrl = new String(normalizeLink.call(md, url))
originalURLMap.set(imprimitiveUrl, url)

Expand Down
2 changes: 1 addition & 1 deletion src/markdown/inline_svg.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @module */
import marpitPlugin from '../plugin'
import split from '../helpers/split'
import wrapTokens from '../helpers/wrap_tokens'
import marpitPlugin from '../plugin'

/**
* Marpit Inline SVG plugin.
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/slide.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @module */
import marpitPlugin from '../plugin'
import split from '../helpers/split'
import wrapTokens from '../helpers/wrap_tokens'
import marpitPlugin from '../plugin'

/**
* Marpit slide plugin.
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/slide_container.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @module */
import marpitPlugin from '../plugin'
import split from '../helpers/split'
import wrapArray from '../helpers/wrap_array'
import wrapTokens from '../helpers/wrap_tokens'
import marpitPlugin from '../plugin'

/**
* Marpit slide container plugin.
Expand Down
10 changes: 5 additions & 5 deletions src/marpit.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import MarkdownIt from 'markdown-it'
import wrapArray from './helpers/wrap_array'
import ThemeSet from './theme_set'
import { marpitContainer } from './element'
import marpitApplyDirectives from './markdown/directives/apply'
import wrapArray from './helpers/wrap_array'
import marpitBackgroundImage from './markdown/background_image'
import marpitCollect from './markdown/collect'
import marpitComment from './markdown/comment'
import marpitContainerPlugin from './markdown/container'
import marpitApplyDirectives from './markdown/directives/apply'
import marpitParseDirectives from './markdown/directives/parse'
import marpitFragment from './markdown/fragment'
import marpitHeaderAndFooter from './markdown/header_and_footer'
import marpitHeadingDivider from './markdown/heading_divider'
import marpitInlineSVG from './markdown/inline_svg'
import marpitParseDirectives from './markdown/directives/parse'
import marpitImage from './markdown/image'
import marpitInlineSVG from './markdown/inline_svg'
import marpitSlide from './markdown/slide'
import marpitSlideContainer from './markdown/slide_container'
import marpitStyleAssign from './markdown/style/assign'
import marpitStyleParse from './markdown/style/parse'
import marpitSweep from './markdown/sweep'
import ThemeSet from './theme_set'

const defaultOptions = {
container: marpitContainer,
Expand Down
4 changes: 2 additions & 2 deletions test/markdown/background_image.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import cheerio from 'cheerio'
import MarkdownIt from 'markdown-it'
import applyDirectives from '../../src/markdown/directives/apply'
import backgroundImage from '../../src/markdown/background_image'
import comment from '../../src/markdown/comment'
import inlineSVG from '../../src/markdown/inline_svg'
import applyDirectives from '../../src/markdown/directives/apply'
import parseDirectives from '../../src/markdown/directives/parse'
import image from '../../src/markdown/image'
import inlineSVG from '../../src/markdown/inline_svg'
import slide from '../../src/markdown/slide'

const splitBackgroundKeywords = ['left', 'right']
Expand Down
6 changes: 3 additions & 3 deletions test/markdown/collect.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import dedent from 'dedent'
import MarkdownIt from 'markdown-it'
import applyDirectives from '../../src/markdown/directives/apply'
import { ThemeSet } from '../../src/index'
import collect from '../../src/markdown/collect'
import comment, { markAsParsed } from '../../src/markdown/comment'
import inlineSVG from '../../src/markdown/inline_svg'
import applyDirectives from '../../src/markdown/directives/apply'
import parseDirectives from '../../src/markdown/directives/parse'
import inlineSVG from '../../src/markdown/inline_svg'
import slide from '../../src/markdown/slide'
import { ThemeSet } from '../../src/index'

describe('Marpit collect plugin', () => {
const themeSet = new ThemeSet()
Expand Down
2 changes: 1 addition & 1 deletion test/markdown/directives/apply.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import cheerio from 'cheerio'
import dedent from 'dedent'
import MarkdownIt from 'markdown-it'
import applyDirectives from '../../../src/markdown/directives/apply'
import comment from '../../../src/markdown/comment'
import applyDirectives from '../../../src/markdown/directives/apply'
import parseDirectives from '../../../src/markdown/directives/parse'
import slide from '../../../src/markdown/slide'

Expand Down
4 changes: 2 additions & 2 deletions test/markdown/header_and_footer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import cheerio from 'cheerio'
import MarkdownIt from 'markdown-it'
import applyDirectives from '../../src/markdown/directives/apply'
import comment from '../../src/markdown/comment'
import applyDirectives from '../../src/markdown/directives/apply'
import parseDirectives from '../../src/markdown/directives/parse'
import slide from '../../src/markdown/slide'
import headerAndFooter from '../../src/markdown/header_and_footer'
import slide from '../../src/markdown/slide'

describe('Marpit header and footer plugin', () => {
const themeSet = new Map()
Expand Down
2 changes: 1 addition & 1 deletion test/markdown/heading_divider.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import cheerio from 'cheerio'
import MarkdownIt from 'markdown-it'
import comment from '../../src/markdown/comment'
import headingDivider from '../../src/markdown/heading_divider'
import parseDirectives from '../../src/markdown/directives/parse'
import headingDivider from '../../src/markdown/heading_divider'
import slide from '../../src/markdown/slide'

describe('Marpit heading divider plugin', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/markdown/image.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import cheerio from 'cheerio'
import MarkdownIt from 'markdown-it'
import applyDirectives from '../../src/markdown/directives/apply'
import backgroundImage from '../../src/markdown/background_image'
import comment from '../../src/markdown/comment'
import inlineSVG from '../../src/markdown/inline_svg'
import applyDirectives from '../../src/markdown/directives/apply'
import parseDirectives from '../../src/markdown/directives/parse'
import headerAndFooter from '../../src/markdown/header_and_footer'
import image from '../../src/markdown/image'
import inlineSVG from '../../src/markdown/inline_svg'
import slide from '../../src/markdown/slide'

describe('Marpit image plugin', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/markdown/inline_svg.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import cheerio from 'cheerio'
import MarkdownIt from 'markdown-it'
import slide from '../../src/markdown/slide'
import { Theme, ThemeSet } from '../../src/index'
import inlineSVG from '../../src/markdown/inline_svg'
import slide from '../../src/markdown/slide'
import skipThemeValidationSymbol from '../../src/theme/symbol'
import { Theme, ThemeSet } from '../../src/index'

describe('Marpit inline SVG plugin', () => {
const marpitStub = (props = {}) => ({
Expand Down
2 changes: 1 addition & 1 deletion test/markdown/style/assign.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import cheerio from 'cheerio'
import dedent from 'dedent'
import MarkdownIt from 'markdown-it'
import applyDirectives from '../../../src/markdown/directives/apply'
import comment from '../../../src/markdown/comment'
import applyDirectives from '../../../src/markdown/directives/apply'
import parseDirectives from '../../../src/markdown/directives/parse'
import slide from '../../../src/markdown/slide'
import styleAssign from '../../../src/markdown/style/assign'
Expand Down
4 changes: 2 additions & 2 deletions test/markdown/sweep.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import cheerio from 'cheerio'
import dedent from 'dedent'
import MarkdownIt from 'markdown-it'
import applyDirectives from '../../src/markdown/directives/apply'
import backgroundImage from '../../src/markdown/background_image'
import comment from '../../src/markdown/comment'
import inlineSVG from '../../src/markdown/inline_svg'
import applyDirectives from '../../src/markdown/directives/apply'
import parseDirectives from '../../src/markdown/directives/parse'
import image from '../../src/markdown/image'
import inlineSVG from '../../src/markdown/inline_svg'
import slide from '../../src/markdown/slide'
import sweep from '../../src/markdown/sweep'

Expand Down
2 changes: 1 addition & 1 deletion test/marpit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cheerio from 'cheerio'
import dedent from 'dedent'
import postcss from 'postcss'
import MarkdownIt from 'markdown-it'
import postcss from 'postcss'
import { Marpit, ThemeSet } from '../src/index'

describe('Marpit', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/postcss/printable.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dedent from 'dedent'
import postcss from 'postcss'
import { findAtRule, findDecl, findRule } from '../_supports/postcss_finder'
import printable, { postprocess } from '../../src/postcss/printable'
import { findAtRule, findDecl, findRule } from '../_supports/postcss_finder'

describe('Marpit PostCSS printable plugin', () => {
const run = (input, opts) =>
Expand Down
2 changes: 1 addition & 1 deletion test/postcss/pseudo_selector/replace.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dedent from 'dedent'
import postcss from 'postcss'
import replace from '../../../src/postcss/pseudo_selector/replace'
import { Element } from '../../../src/index'
import replace from '../../../src/postcss/pseudo_selector/replace'

describe('Marpit PostCSS pseudo selector replace plugin', () => {
const run = (input, ...opts) =>
Expand Down
2 changes: 1 addition & 1 deletion test/postcss/root/rem.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dedent from 'dedent'
import postcss from 'postcss'
import { rootFontSizeCustomProp } from '../../../src/postcss/root/replace'
import rem from '../../../src/postcss/root/rem'
import { rootFontSizeCustomProp } from '../../../src/postcss/root/replace'

describe('Marpit PostCSS rem plugin', () => {
const run = (input) => postcss([rem()]).process(input, { from: undefined })
Expand Down
4 changes: 2 additions & 2 deletions test/postcss/root/replace.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import dedent from 'dedent'
import postcss from 'postcss'
import prependSlide from '../../../src/postcss/pseudo_selector/prepend'
import replaceSlide from '../../../src/postcss/pseudo_selector/replace'
import replace, {
rootFontSizeCustomProp,
} from '../../../src/postcss/root/replace'
import prependSlide from '../../../src/postcss/pseudo_selector/prepend'
import replaceSlide from '../../../src/postcss/pseudo_selector/replace'

describe('Marpit PostCSS root replace plugin', () => {
const run = (input, plugins = []) =>
Expand Down
2 changes: 1 addition & 1 deletion test/theme.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dedent from 'dedent'
import skipThemeValidationSymbol from '../src/theme/symbol'
import { Theme } from '../src/index'
import skipThemeValidationSymbol from '../src/theme/symbol'

describe('Theme', () => {
describe('.fromCSS', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/theme_set.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dedent from 'dedent'
import scaffoldTheme from '../src/theme/scaffold'
import { ThemeSet, Theme } from '../src/index'
import scaffoldTheme from '../src/theme/scaffold'

describe('ThemeSet', () => {
let instance
Expand Down
Loading

0 comments on commit c23ec59

Please sign in to comment.